Part Number Hot Search : 
STP9434 PSBH50 BYT28B N5400 C102M C102M 19401137 82217
Product Description
Full Text Search
 

To Download HC05K3GRS Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  order this document by mc68hc05k3/d rev. 4.0 non-disclosure agreement required mc68hc05k3 hcmos mic r ocont r oller unit techni c al dat a h c 5

mc68hc05k3 revision 4.0 technical data motorola list of sections 3 technical data mc68hc05k3 list of sections section 1. general description . . . . . . . . . . . . . . . . . . . 15 section 2. memory map . . . . . . . . . . . . . . . . . . . . . . . . . 27 section 3. central processor unit (cpu) core . . . . . . . . 35 section 4. interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 section 5. resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 section 6. operational modes . . . . . . . . . . . . . . . . . . . . 53 section 7. parallel input/output (i/o) . . . . . . . . . . . . . . 59 section 8. 8-bit timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 section 9. personality eeprom (peeprom) . . . . . . . . . . 79 section 10. instruction set . . . . . . . . . . . . . . . . . . . . . . . . 97 section 11. electrical specifications . . . . . . . . . . . . . . 115 section 12. mechanical specifications . . . . . . . . . . . . 123 section 13. ordering information . . . . . . . . . . . . . . . . . 127
technical data mc68hc05k3 revision 4.0 4 list of sections motorola list of sections
mc68hc05k3 revision 4.0 technical data motorola table of contents 5 technical data mc68hc05k3 table of contents section 1. general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 1.4 mask options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 1.5 pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 1.6 mcu structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.7 functional pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.7.1 v dd and v ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.7.2 osc1 and osc2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 1.7.2.1 2-pin crystal oscillator. . . . . . . . . . . . . . . . . . . . . . . . . . .21 1.7.2.2 2-pin ceramic resonator oscillator. . . . . . . . . . . . . . . . .22 1.7.2.3 2-pin rc oscillators. . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.7.2.4 3-pin rc oscillator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.7.2.5 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 1.7.3 reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 1.7.4 maskable interrupt request ( irq) . . . . . . . . . . . . . . . . . . . .24 1.7.5 pa0Cpa7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.7.6 pb0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.7.7 pb1/osc3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 section 2. memory map 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 2.3 input/output and control registers . . . . . . . . . . . . . . . . . . . . .29 2.4 random-access memory (ram) . . . . . . . . . . . . . . . . . . . . . . .33 2.5 read-only memory (rom). . . . . . . . . . . . . . . . . . . . . . . . . . . .33
technical data mc68hc05k3 revision 4.0 6 table of contents motorola table of contents section 3. central processor unit (cpu) core 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3.3.1 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.3.2 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 section 4. interrupts 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 4.3 central processor unit (cpu) interrupt processing . . . . . . . . .40 4.4 reset interrupt sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.5 software interrupt (swi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.6 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.6.1 external interrupt ( irq) . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.6.2 irq status/control register. . . . . . . . . . . . . . . . . . . . . . . . .45 4.6.3 port a interrupts (pa0Cpa3) . . . . . . . . . . . . . . . . . . . . . . . .46 4.6.4 timer interrupt (timer) . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 section 5. resets 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 5.3 external reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 5.4 internal resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 5.4.1 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 5.4.2 computer operating properly reset (copr) . . . . . . . . . . .51 5.4.3 illegal address reset (iladr) . . . . . . . . . . . . . . . . . . . . . . .51
table of contents mc68hc05k3 revision 4.0 technical data motorola table of contents 7 section 6. operational modes 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.3 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.3.1 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 6.3.2 halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 6.3.3 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 6.3.4 cop watchdog timer considerations . . . . . . . . . . . . . . . . .57 6.4 peeprom serial programming mode . . . . . . . . . . . . . . . . . . .57 section 7. parallel input/output (i/o) 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7.3.1 port a data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 7.3.2 port a data direction register . . . . . . . . . . . . . . . . . . . . . . .61 7.3.3 port a pulldown inhibit register. . . . . . . . . . . . . . . . . . . . . .61 7.3.4 port a light-emitting diode (led) drive capability . . . . . . .62 7.3.5 port a i/o pin interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 7.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 7.4.1 port b data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 7.4.2 port b data direction register . . . . . . . . . . . . . . . . . . . . . . .65 7.4.3 port b pulldown inhibit register. . . . . . . . . . . . . . . . . . . . . .65 7.4.4 port b with 3-pin rc oscillator . . . . . . . . . . . . . . . . . . . . . .66 7.5 i/o port programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 7.5.1 pin data direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 7.5.2 output pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 7.5.3 input pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 7.5.4 i/o pin transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 7.5.5 i/o pin truth tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68
technical data mc68hc05k3 revision 4.0 8 table of contents motorola table of contents section 8. 8-bit timer 8.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 8.3 timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 8.3.1 timer counter register . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 8.3.2 timer status/control register . . . . . . . . . . . . . . . . . . . . . . .74 8.4 cop watchdog timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 8.5 operating during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . .77 8.6 operating during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . .77 section 9. personality eeprom (peeprom) 9.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.3 peeprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 9.3.1 peeprom bit select register. . . . . . . . . . . . . . . . . . . . . . .81 9.3.2 peeprom status/control register . . . . . . . . . . . . . . . . . . .82 9.4 peeprom programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 9.5 peeprom read access . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 9.6 peeprom serial programming . . . . . . . . . . . . . . . . . . . . . . . .87 9.6.1 serial programming connections. . . . . . . . . . . . . . . . . . . . .87 9.6.2 multiple devices in serial program mode . . . . . . . . . . . . . .88 9.6.3 peeprom serial programming mode entry . . . . . . . . . . . .89 9.7 serial programming sequence. . . . . . . . . . . . . . . . . . . . . . . . .91 9.8 serial data readout sequence . . . . . . . . . . . . . . . . . . . . . . . .95 9.9 serial bulk erase sequence . . . . . . . . . . . . . . . . . . . . . . . . . . .96 section 10. instruction set 10.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
table of contents mc68hc05k3 revision 4.0 technical data motorola table of contents 9 10.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 10.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.3.2 immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 10.3.6 indexed, 8-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 10.3.7 indexed,16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 10.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 10.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 10.4.1 register/memory instructions. . . . . . . . . . . . . . . . . . . . . . .102 10.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .103 10.4.3 jump/branch instructions. . . . . . . . . . . . . . . . . . . . . . . . . .104 10.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .106 10.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 10.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 section 11. electrical specifications 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 11.3 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 11.4 operating range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 11.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 11.6 5.0-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .118 11.7 3.0-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .119 11.8 5.0-volt control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120 11.9 3.0-volt control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 11.10 1.8-volt control timing (peeprom read only) . . . . . . . . . .122
technical data mc68hc05k3 revision 4.0 10 table of contents motorola table of contents section 12. mechanical specifications 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 12.3 dual in-line package (case 648). . . . . . . . . . . . . . . . . . . . . .124 12.4 small outline integrated circuit (case 751) . . . . . . . . . . . . . .124 12.5 super small outline package (case 940c) . . . . . . . . . . . . . .125 section 13. ordering information 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 13.3 mcu ordering forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 13.4 application program media. . . . . . . . . . . . . . . . . . . . . . . . . . .128 13.5 rom program verification . . . . . . . . . . . . . . . . . . . . . . . . . . .129 13.6 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130
mc68hc05k3 revision 4.0 technical data motorola list of figures 11 technical data mc68hc05k3 list of figures figure title page 1-1 pin assignments for 16-pin pdip. . . . . . . . . . . . . . . . . . . . .18 1-2 pin assignments for 16-pin soic . . . . . . . . . . . . . . . . . . . .18 1-3 pin assignments for 20-pin ssop . . . . . . . . . . . . . . . . . . . .19 1-4 mc68hc05k3 block diagram . . . . . . . . . . . . . . . . . . . . . . .20 1-5 oscillator connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 2-1 mc68hc05k3 single-chip mode memory map. . . . . . . . . .28 2-2 mc68hc05k3 i/o registers memory map . . . . . . . . . . . . .29 2-3 mc68hc05k3 i/o registers . . . . . . . . . . . . . . . . . . . . . . . .30 3-1 m68hc05 programming model . . . . . . . . . . . . . . . . . . . . . .36 4-1 interrupt processing flowchart. . . . . . . . . . . . . . . . . . . . . . .41 4-2 interrupt stacking order . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4-3 irq function block diagram . . . . . . . . . . . . . . . . . . . . . . . .43 4-4 irq status/control register (iscr) . . . . . . . . . . . . . . . . . . .45 5-1 reset block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 6-1 stop/halt/wait flowcharts . . . . . . . . . . . . . . . . . . . . . . . . . .55 7-1 port a i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7-2 port a pulldown inhibit register (pdra) . . . . . . . . . . . . . . .62 7-3 port b i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 7-4 port b pulldown inhibit register (pdrb) . . . . . . . . . . . . . . .65 8-1 timer block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 8-2 timer counter register (tcntr) . . . . . . . . . . . . . . . . . . . .73
technical data mc68hc05k3 revision 4.0 12 list of figures motorola list of figures figure title page 8-3 timer status/control register (tscr) . . . . . . . . . . . . . . . . .74 8-4 copr watchdog timer location . . . . . . . . . . . . . . . . . . . . .76 9-1 personality eeprom block diagram. . . . . . . . . . . . . . . . . .80 9-2 peeprom bit select register (pebsr) . . . . . . . . . . . . . . .81 9-3 peeprom status/control register (pescr) . . . . . . . . . . .82 9-4 serial programming connections. . . . . . . . . . . . . . . . . . . . .88 9-5 peeprom serial programming mode data format . . . . . .90 9-6 peeprom serial programming data in timing . . . . . . . . .92 9-7 peeprom serial read data out timing . . . . . . . . . . . . . .93 9-8 bulk erase sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93
mc68hc05k3 revision 4.0 technical data motorola list of tables 13 technical data mc68hc05k3 list of tables table title page 4-1 vector addresses for interrupts and reset . . . . . . . . . . . . . .40 7-1 port a pin functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 7-2 pb0 pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 7-3 pb1/osc3 pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 8-1 rti rates and cop reset times . . . . . . . . . . . . . . . . . . . . .75 9-1 software to read peeprom. . . . . . . . . . . . . . . . . . . . . . . . .83 9-2 peeprom serial programming mode operations . . . . . . . .90 9-3 internal test time delays. . . . . . . . . . . . . . . . . . . . . . . . . . . .94 10-1 register/memory instructions. . . . . . . . . . . . . . . . . . . . . . . .102 10-2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . . .103 10-3 jump and branch instructions . . . . . . . . . . . . . . . . . . . . . . .105 10-4 bit manipulation instructions. . . . . . . . . . . . . . . . . . . . . . . . .106 10-5 control instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 10-6 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . .108 10-7 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114 13-1 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130
technical data mc68hc05k3 revision 4.0 14 list of tables motorola list of tables
mc68hc05k3 revision 4.0 technical data motorola general description 15 technical data mc68hc05k3 section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 1.4 mask options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 1.5 pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 1.6 mcu structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.7 functional pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.7.1 v dd and v ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.7.2 osc1 and osc2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 1.7.2.1 2-pin crystal oscillator. . . . . . . . . . . . . . . . . . . . . . . . . . .21 1.7.2.2 2-pin ceramic resonator oscillator. . . . . . . . . . . . . . . . .22 1.7.2.3 2-pin rc oscillators. . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.7.2.4 3-pin rc oscillator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.7.2.5 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 1.7.3 reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 1.7.4 maskable interrupt request ( irq) . . . . . . . . . . . . . . . . . . . .24 1.7.5 pa0Cpa7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.7.6 pb0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.7.7 pb1/osc3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.2 introduction the low-cost mc68hc05k3 microcontroller (mcu) is a member of the m68hc05 family of microprocessors. this device has 64 bytes of user ram, 128 bits of personality electronically erasable programmable rom (peeprom), and 928 bytes of user rom. this device is available in the 16-pin plastic dual in-line package (pdip), 16-pin small outline integrated circuit (soic) package, and 20-pin super small outline
technical data mc68hc05k3 revision 4.0 16 general description motorola general description (ssop) package. a functional block diagram of the mc68hc05k3 is shown in figure 1-4 . 1.3 features ? low-cost hc05 core ? 16-pin pdip, 16-pin soic package, or 20-pin ssop ? 928 bytes of user rom, including eight bytes of user vectors ? 64 bytes of user ram ? low-power operation at 1.8 v v dd minimum (eeprom read only) ? 128 bits of personality eeprom (not memory mapped) programmed using cpu software or with on-chip serial programming rom ? on-chip charge pump for in-circuit programming of the personality eeprom at 2.7 to 5.5 vdc ? 8-bit free-running timer ? 4-stage selectable real-time interrupt generator ? 10 bidirectional input/output (i/o) lines including: C 8-ma sink capability on four i/o pins (pa7Cpa4) C mask option for software programmable pulldowns on all i/o pins C mask option for port interrupts on four i/o pins (pa3Cpa0) (keyboard scan feature) ? irq interrupt hardware mask, flag bit, and request bit ? mask option for sensitivity on irq interrupt (edge- and level-sensitive or edge-sensitive only) ? on-chip oscillator (mask options for crystal/ceramic resonator oscillator with internal 2-m w resistor and 2-pin or 3-pin resistor capacitor (rc) oscillator)
general description mask options mc68hc05k3 revision 4.0 technical data motorola general description 17 ? mask option for reduced startup delay time with rc oscillator options ? mask option for computer operating properly (cop) watchdog system ? power-saving stop mode and wait mode instructions ? mask option to convert stop instruction to halt mode ? illegal address reset ? internal steering diode and pullup resistor on reset pin to v dd ? internal reset pin pulldown from cop watchdog and iladr note: a line over a signal name indicates an active low signal. for example, reset is active high and reset is active low. any reference to voltage, current, or frequency specified in the following sections refers to the nominal values. the exact values and their tolerance or limits are specified in section 11. electrical specifications . 1.4 mask options the mc68hc05k3 contains these eight mask options: 1. cop watchdog timer (enable or disable) 2. irq triggering (edge-sensitive or edge- and level-sensitive) 3. port a interrupts (enable or disable) 4. port software programmable pulldowns (enable or disable) 5. stop instruction (enable or disable) 6. oscillator type (crystal/ceramic resonator or rc) 7. rc oscillator type (2-pin or 3-pin) 8. rc oscillator startup delay (4064 or 16 f op cycles) note: the startup delay of 16 f op cycles and the crystal/ceramic resonator oscillator should not be selected together.
technical data mc68hc05k3 revision 4.0 18 general description motorola general description 1.5 pin assignments the mc68hc05k3 is available in 16-pin pdip, 16-pin soic, and 20-pin ssop packages. the pin assignments for these packages are shown in figure 1-1 , figure 1-2 , and figure 1-3 . figure 1-1. pin assignments for 16-pin pdip figure 1-2. pin assignments for 16-pin soic reset 1 pb1/osc3 2 pb0 3 irq 4 pa0 5 pa1 6 pa2 7 pa3 8 osc1 16 osc2 15 v ss 14 v dd 13 pa7 12 pa6 11 pa5 10 pa4 9 16-pin pdip package 16-pin soic package osc1 16 osc2 15 v ss 14 v dd 13 pa7 12 pa6 11 pa5 10 pa4 9 reset 1 pb1/ocs3 2 pb0 3 irq 4 pa0 5 pa1 6 pa2 7 pa3 8
general description mcu structure mc68hc05k3 revision 4.0 technical data motorola general description 19 figure 1-3. pin assignments for 20-pin ssop 1.6 mcu structure the overall block diagram of the mc68hc05k3 is shown in figure 1-4 . 1.7 functional pin description the following paragraphs give a description of the general function of each pin. 1.7.1 v dd and v ss power is supplied to the mcu through v dd and v ss .v dd is the positive supply and v ss is ground. the mcu operates from a single power supply. rapid signal transitions occur on the mcu pins. the short rise and fall times place very high short-duration current demands on the power supply. to prevent noise problems, special care should be taken to provide good power supply bypassing at the mcu by using bypass capacitors with high-frequency characteristics that are positioned as close to the mcu as possible. reset 1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 pb1/osc3 pb0 irq n/c n/c pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 n/c n/c v dd v ss osc2 osc1 20-pin ssop package
technical data mc68hc05k3 revision 4.0 20 general description motorola general description figure 1-4. mc68hc05k3 block diagram sp data direction reg port b watchdog & illegal address detect 8-bit timer system selectable oscillator cond code register 1 1 1 i n z c h index register cpu control 000 1 1 0 0 0 0 0 reset osc 1 osc 2 sram 64 bytes user rom 928 bytes irq alu 68hc05 cpu accum program counter cpu registers pa7 * pa0 ** pa1 ** pa2 ** pa3 ** pa4 * pa5 * pa6 * data direction register port a v dd v ss pb0 pb1/osc3 * 8-ma sink capability ** irq interrupt capability 1 ? 2 personality eeprom 128 bits on-chip charge pump serial program and internal test rom 256 bytes
general description functional pin description mc68hc05k3 revision 4.0 technical data motorola general description 21 1.7.2 osc1 and osc2 the osc1 and osc2 pins are the connections for the 2-pin on-chip oscillator. the osc1 and osc2 pins also can be used in conjunction with the pb1/osc3 pin to create a more stable 3-pin rc oscillator. the osc1, osc2, and pb1/osc3 pins can accept these sets of components: 1. a crystal, as shown in figure 1-5 (a) 2. a ceramic resonator, as shown in figure 1-5 (a) 3. an external resistor and capacitor using two pins, as shown in figure 1-5 (b) 4. an external resistor and capacitor using three pins, as shown in figure 1-5 (c) 5. an external clock signal, as shown in figure 1-5 (d) the frequency, f osc , of the oscillator or external clock source is divided by two to produce the internal operating frequency, f op . the oscillator type is selected by two mask options. 1.7.2.1 2-pin crystal oscillator the circuit in figure 1-5 (a) shows a typical 2-pin oscillator circuit for an at-cut, parallel resonant crystal. the crystal manufacturers recommendations should be followed, since the crystal parameters determine the external component values required to provide maximum stability and reliable startup. the load capacitance values used in the oscillator circuit design should include all stray capacitances. the crystal and components should be mounted as close as possible to the pins for startup stabilization and to minimize output distortion. an internal startup resistor of approximately 2 m w is provided between osc1 and osc2 when the crystal/ceramic resonator oscillator option is used.
technical data mc68hc05k3 revision 4.0 22 general description motorola general description figure 1-5. oscillator connections 1.7.2.2 2-pin ceramic resonator oscillator in cost-sensitive applications, a ceramic resonator can be used instead of the crystal. the circuit in figure 1-5 (a) is designed for either a crystal or a ceramic resonator. the resonator manufacturers recommendations should be followed, since the resonator parameters determine the external component values required for maximum stability and reliable starting. the load capacitance values used in the oscillator circuit design should include all stray capacitances. the ceramic resonator and components should be mounted as close as possible to the pins for startup stabilization and to minimize output distortion. an internal startup resistor of approximately 2 m w is provided between osc1 and osc2 for the crystal/ceramic resonator oscillator mask option. mcu 36 (a) 2-pin crystal or ceramic resonator connections osc1 osc2 36 pf* 2 m w (mask option) r unconnected external clock r c (b) 2-pin rc oscillator connections (d) external clock source connection (c) 3-pin rc oscillator connections c osc1 osc2 mcu osc1 osc2 mcu osc1 osc2 mcu pb1/osc3 * starting value only. follow crystal suppliers recommendations regarding component values that will provide reliable startup and maximum stability.
general description functional pin description mc68hc05k3 revision 4.0 technical data motorola general description 23 1.7.2.3 2-pin rc oscillators the 2-pin rc oscillator configuration can be used for very low-cost applications. with this option, a resistor must be connected between the two oscillator pins and a capacitor must be connected from the osc1 pin to v ss , as shown in figure 1-5 (b) . the signal on the osc2 pin is a square wave and the signal on the osc1 pin approximates a triangular wave. the 2-pin rc oscillator is optimized for operation at 500 khz. this oscillator can be used at higher or lower frequencies with degraded accuracy over temperature, supply voltage, and/or device processing variations. the internal startup resistor of approximately 2 m w is not connected between osc1 and osc2 when the 2-pin rc oscillator mask option is selected. 1.7.2.4 3-pin rc oscillator another low cost, but more accurate, type of rc oscillator is the 3-pin configuration utilizing the pb1/osc3 pin. with this option, a resistor must be connected between the osc1 and osc2 pins and a capacitor must be connected between the osc1 and pb1/osc3 pins, as shown in figure 1-5 (c) . this 3-pin rc oscillator is more accurate than the 2-pin rc oscillator with respect to temperature, supply voltage, and/or device processing variations. the signal on the osc2 and pb1/osc3 pins is a square wave and the signal on the osc1 pin approximates a triangular wave. the 3-pin rc oscillator is optimized for operation at 500 khz. this oscillator can be used at higher or lower frequencies with degraded accuracy over temperature, supply voltage, and/or device processing variations. the internal startup resistor of approximately 2 m w is not connected between osc1 and osc2 when the 3-pin rc oscillator mask option is selected. the typical external components for a 500-khz oscillator are a 20-k w resistor and a 25- to 30-pf capacitor. note: capacitors used with the rc oscillators should have minimal leakage. electrolytic or tantalum capacitors should not be used because they degrade the temperature performance of the oscillator due to excessive variation in their leakage.
technical data mc68hc05k3 revision 4.0 24 general description motorola general description 1.7.2.5 external clock an external clock from another cmos-compatible device can be connected to the osc1 input, with the osc2 input not connected, as shown in figure 1-5 (d) . this configuration is possible regardless of whether the oscillator is set up for crystal/ceramic resonator, 2-pin rc, or 3-pin rc operation. however, if the 3-pin rc oscillator is selected, the pb1/osc3 pin also must be left unconnected. 1.7.3 reset ( reset) this pin can be used as an input to reset the mcu to a known startup state by pulling the pin to the low state. the reset pin contains a steering diode to discharge any voltage on the pin to v dd when the power is removed. the reset pin contains an internal pullup resistor to v dd of approximately 100 k w to allow the reset pin to be left unconnected for low-power applications. the reset pin contains an internal schmitt trigger to improve its noise immunity as an input. the reset pin has an internal pulldown device that pulls the reset pin low when there is an internal cop watchdog or an illegal address reset. refer to section 5. resets . 1.7.4 maskable interrupt request ( irq) the irq input pin drives the asynchronous irq interrupt function of the cpu. the irq interrupt function has a mask option to select either negative edge-sensitive triggering or both negative edge-sensitive and low level-sensitive triggering. if the option is selected to include level-sensitive triggering, the irq pin requires an external resistor to v dd if wired-or operation is desired. if the irq pin is not used, it must be tied to the v dd supply. note: each of the pa0Cpa3 i/o pins can be connected through an or gate to the irq interrupt function by a common mask option. this capability allows keyboard scan applications where the transitions or levels on the i/o pins behave the same as the irq pin, except that the logic level is
general description functional pin description mc68hc05k3 revision 4.0 technical data motorola general description 25 inverted. the edge or level sensitivity selected by the mask option for the irq pin also applies to the i/o pins ored to create an irq signal. the irq pin contains an internal schmitt trigger to improve noise immunity. for more details, see section 4. interrupts . 1.7.5 pa0Cpa7 these eight i/o lines comprise port a. the state of any pin is software programmable and all port a lines are configured as inputs during power-on or reset, except in serial program mode. the four upper-order i/o pins (pa4Cpa7) are capable of sinking higher currents. the four lower-order i/o pins (pa0Cpa3) can be connected via an internal or gate to the irq interrupt function by a mask option. all the port a pins can have software programmable pulldown devices provided by another mask option. see section 7. parallel input/output (i/o) for more details on the i/o ports. 1.7.6 pb0 the state of the pb0 pin is software programmable and is configured as an input during power-on or reset, except in serial program mode. this pin can have a software programmable pulldown device provided by a mask option. see section 7. parallel input/output (i/o) for more details on the i/o ports. 1.7.7 pb1/osc3 the state of the pb1/osc3 pin is software programmable and is configured as an input during power-on or reset, except in serial program mode or when the 3-pin rc oscillator configuration is selected by mask option. this pin can have a software programmable pulldown device provided by a mask option. see section 7. parallel input/output (i/o) for more details on the i/o ports.
technical data mc68hc05k3 revision 4.0 26 general description motorola general description
mc68hc05k3 revision 4.0 technical data motorola memory map 27 technical data mc68hc05k3 section 2. memory map 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 2.3 input/output and control registers . . . . . . . . . . . . . . . . . . . . .29 2.4 random-access memory (ram) . . . . . . . . . . . . . . . . . . . . . . .33 2.5 read-only memory (rom). . . . . . . . . . . . . . . . . . . . . . . . . . . .33
technical data mc68hc05k3 revision 4.0 28 memory map motorola memory map 2.2 introduction the mc68hc05k3 has several input/output (i/o) features, 64 bytes of user random-access memory (ram), 128 bits of user personality electronically erasable programmable read-only memory (peeprom), and 928 bytes of user read-only memory (rom), which are all active in the single-chip mode as shown in figure 2-1 . figure 2-1. mc68hc05k3 single-chip mode memory map user vectors rom 8 bytes user rom 160 bytes 1023 1016 stack 32 bytes user ram 64 bytes reset vector (low byte) reset vector (high byte) swi vector (low byte) swi vector (high byte) irq vector (low byte) irq vector (high byte) timer vector (low byte) timer vector (high byte) $03f8 $03f9 $03fa $03fb $03fc $03fd $03fe $03ff $0100 $00ff 0255 0256 i/o 32 bytes (see figure 2-2 ) 0032 0031 0000 $03ff $03f8 $03f7 $00e0 $00df $0020 $001f $0000 user rom 760 bytes 0224 0223 0192 0191 $00c0 $00bf 1008 $03f0 cop watchdog timer
memory map input/output and control registers mc68hc05k3 revision 4.0 technical data motorola memory map 29 2.3 input/output and control registers the input/output (i/o) and status/control registers reside in locations $0000C$001f. the overall organization of these registers is shown in figure 2-2 . the bit assignments for each register are shown in figure 2-3 . reading unimplemented bits returns unknown states, and writing to unimplemented bits has no effect. figure 2-2. mc68hc05k3 i/o registers memory map port a data register port b data register port a data direction register port b data direction register timer status & control register timer counter register peeprom control & status register reserved unimplemented (2) unimplemented (2) unimplemented (3) unimplemented (13) irq status & control register port a pulldown register port b pulldown register $0000 $0001 $0004 $0005 $0008 $0009 $001f $000a $0010 $0011 $000f $000f peeprom bit select register $000e
technical data mc68hc05k3 revision 4.0 30 memory map motorola memory map addr. name bit 7 6 5 4 3 2 1 bit 0 $0000 port a data (porta) read: pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 write: reset: unaffected by reset $0001 port b data (portb) read: 0 0 0 0 0 0 pb1 pb0 write: reset: unaffected by reset $0002 unimplemented read: write: $0003 unimplemented read: write: $0004 port a data direction (ddra) read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset: 0 0 0 0 0 0 0 0 $0005 port b data direction (ddrb) read: 0 0 0 0 0 0 ddrb1 ddrb0 write: reset: 0 0 0 0 0 0 0 0 $0006 unimplemented read: write: $0007 unimplemented read: write: $0008 timer status/control (tscr) read: tof rtif toie rtie 00 rt1 rt0 write: tofr rtifr reset: 0 0 0 0 0 0 1 1 = unimplemented r = reserved figure 2-3. mc68hc05k3 i/o registers (sheet 1 of 4)
memory map input/output and control registers mc68hc05k3 revision 4.0 technical data motorola memory map 31 $0009 timer counter (tcntr) read: tcr7 tcr6 tcr5 tcr4 tcr3 tcr2 tcr1 tcr0 write: reset: 0 0 0 0 0 0 0 0 $000a irq status/control (iscr) read: irqe 0 0 0 irqf 0 0 0 write: r irqr reset: 1 0 0 0 0 0 0 0 $000b unimplemented read: write: $000c unimplemented read: write: $000d unimplemented read: write: $000e personality eeprom bit select (pebsr) read: peb7 peb6 peb5 peb4 peb3 peb2 pdb1 pdb0 write: reset: 0 0 0 0 0 0 0 0 $000f personality eeprom status/control (pescr) read: pedata pebulk pepgm pebyte cpen cpclk 0 pepczf write: reset: 1 0 0 0 0 0 0 1 $0010 port a pulldown inhibit (pdra) read: write: pdia7 pdia6 pdia5 pdia4 pdia3 pdia2 pdia1 pdia0 reset: 0 0 0 0 0 0 0 0 $0011 port b pulldown inhibit (pdrb) read: write: pdib1 pdib0 reset: 0 0 addr. name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved figure 2-3. mc68hc05k3 i/o registers (sheet 2 of 4)
technical data mc68hc05k3 revision 4.0 32 memory map motorola memory map $0012 unimplemented read: write: $0013 unimplemented read: write: $0014 unimplemented read: write: $0015 unimplemented read: write: $0016 unimplemented read: write: $0017 unimplemented read: write: $0018 unimplemented read: write: $0019 unimplemented read: write: $001a unimplemented read: write: $001b unimplemented read: write: addr. name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved figure 2-3. mc68hc05k3 i/o registers (sheet 3 of 4)
memory map random-access memory (ram) mc68hc05k3 revision 4.0 technical data motorola memory map 33 2.4 random-access memory (ram) the total ram consists of 64 bytes (including the stack) at locations $00c0C$00ff. the stack pointer can access 32 locations from $00e0 to $00ff. the stack begins at address $00ff and proceeds down to $00e0. using the stack area for data storage or temporary work locations requires care to prevent it from being overwritten due to stacking from an interrupt or subroutine call. 2.5 read-only memory (rom) there are a total of 928 bytes of user rom on the chip. this includes 160 bytes in page zero from $0020C$00bf, 760 bytes of user rom with locations $0100C$03f7 for user program storage, and 8 bytes of user vectors at locations $03f8C$03ff. $001c unimplemented read: write: $001d unimplemented read: write: $001e unimplemented read: write: $001f reserved read: r rrrrrrr write: addr. name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved figure 2-3. mc68hc05k3 i/o registers (sheet 4 of 4)
technical data mc68hc05k3 revision 4.0 34 memory map motorola memory map
mc68hc05k3 revision 4.0 technical data motorola central processor unit (cpu) core 35 technical data mc68hc05k3 section 3. central processor unit (cpu) core 3.1 contents 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3 registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3.3.1 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.3.2 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.2 introduction the mc68hc05k3 has a 1024-byte memory map. therefore, it uses only the lower 10 bits of the address bus. in the following discussion, the upper six bits of the address bus can be ignored. also, by using a mask option, the stop instruction can be converted from acting as the normal stop instruction. the stack area also is reduced to 32 bytes due to the limited amount of ram. therefore, the stack pointer is reduced to only five bits, only decrements down to $00e0, and then wraps around to $00ff. all other instructions and registers behave as described in m6805 hmos/m146805 cmos family users manual, motorola document order number m6805um/ad3.
technical data mc68hc05k3 revision 4.0 36 central processor unit (cpu) core motorola central processor unit (cpu) core 3.3 registers the mcu contains five registers that are hard-wired within the cpu and are not part of the memory map. these five registers are shown in figure 3-1 . figure 3-1. m68hc05 programming model for a more complete description of the m68hc05 cpu functions, refer to: ? m6805 hmos, m146805 cmos family users manual, motorola order number m6805um(ad3) ? hc05 applications guide, motorola order number m68hc05ag/ad ? understanding small microcontrollers, motorola order number m68hc05tb/d any specific differences in the operation of all cpu registers or bits is described in the following sections. condition code register i 60 a 71 x 4 52 3 stack pointer sp 14 8 15 9 12 13 10 11 pc cc 111 11 0 0 0 0 0 0 0 0 hnzc half-carry bit (from bit 3) interrupt mask negative bit zero bit carry bit 1 program counter index register accumulator 000000
central processor unit (cpu) core registers mc68hc05k3 revision 4.0 technical data motorola central processor unit (cpu) core 37 3.3.1 stack pointer (sp) the stack pointer shown in figure 3-1 is a 16-bit register internally. in devices with memory maps less than 64 kbytes, the unimplemented upper address lines are ignored. the stack pointer contains the address of the next free location on the stack. when accessing memory, the 11 most significant bits are permanently set to 00000000111. the five least significant register bits are appended to these 11 fixed bits to produce an address within the range of $00ff to $00e0. subroutines and interrupts may use up to 32 ($20) locations. if 32 locations are exceeded, the stack pointer wraps around to $00ff and writes over the previously stored information. 3.3.2 program counter (pc) the program counter shown in figure 3-1 is a 16-bit register internally. the program counter contains the address of the next instruction or operand to be fetched. the six most significant bits of the program counter are ignored internally and appear as 000000 when stacked onto the ram.
technical data mc68hc05k3 revision 4.0 38 central processor unit (cpu) core motorola central processor unit (cpu) core
mc68hc05k3 revision 4.0 technical data motorola interrupts 39 technical data mc68hc05k3 section 4. interrupts 4.1 contents 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 4.3 central processor unit (cpu) interrupt processing . . . . . . . . .40 4.4 reset interrupt sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.5 software interrupt (swi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.6 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.6.1 external interrupt ( irq) . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.6.2 irq status/control register. . . . . . . . . . . . . . . . . . . . . . . . .45 4.6.3 port a interrupts (pa0Cpa3) . . . . . . . . . . . . . . . . . . . . . . . .46 4.6.4 timer interrupt (timer) . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 4.2 introduction the mcu can be interrupted four different ways: 1. non-maskable software interrupt instruction (swi) 2. external asynchronous interrupt ( irq) 3. external interrupt via irq on pa0Cpa3 (enabled by a mask option) 4. internal timer interrupt (timer)
technical data mc68hc05k3 revision 4.0 40 interrupts motorola interrupts 4.3 central processor unit (cpu) interrupt processing interrupts cause the processor to save register contents on the stack and to set the interrupt mask (i bit) to prevent additional interrupts. unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the current instruction is complete. if interrupts are not masked (i bit in the ccr is clear) and the corresponding interrupt enable bit is set, the processor proceeds with interrupt processing. otherwise, the next instruction is fetched and executed. if an interrupt occurs, the processor completes the current instruction, stacks the current cpu register states, sets the i bit to inhibit further interrupts, and finally checks the pending hardware interrupts. if more than one interrupt is pending following the stacking operation, the interrupt with the highest vector location, shown in table 4-1 , is serviced first. the software interrupt (swi) is executed the same as any other instruction, regardless of the i-bit state. when an interrupt is to be processed, the cpu fetches the address of the appropriate interrupt software service routine from the vector table at locations $03f8C$03ff as defined in table 4-1 . table 4-1. vector addresses for interrupts and reset register flag name interrupts cpu interrupts vector addresses n/a n/a reset reset $03feC$03ff n/a n/a software swi $03fcC$03fd iscr irqf external interrupt irq $03faC$03fb tscr tof timer over?ow timer $03f8C$03f9 tscr rtif real-time interrupt timer $03f8C$03f9
interrupts central processor unit (cpu) interrupt processing mc68hc05k3 revision 4.0 technical data motorola interrupts 41 a return-from-interrupt (rti) instruction is used to signify when the interrupt software service routine is complete. the rti instruction causes the register contents to be recovered from the stack and normal processing to resume at the next instruction that was to be executed when the interrupt took place. figure 4-1 shows the sequence of events that occurs during interrupt processing. figure 4-2 shows the stacking and unstacking order into the ram that is associated with an interrupt service routine. figure 4-1. interrupt processing flowchart is i bit set? load pc from: swi: $03fc, $03fd irq: $03faC$03fb timer: $03f8C$03f9 set i bit in ccr stack pcl, pch, x, a, cc clear irq request latch restore registers from stack cc, a, x, pch, pcl y n irq external interrupt? y n timer internal interrupt? y n execute instruction fetch next instruction rti instruction ? y n swi instruction ? y n from reset
technical data mc68hc05k3 revision 4.0 42 interrupts motorola interrupts figure 4-2. interrupt stacking order 4.4 reset interrupt sequence the reset function is not in the strictest sense an interrupt; however, it is acted upon in a similar manner. a low-level input on the reset pin or an internally generated reset (rst) signal causes the program to vector to its starting address, which is specified by the contents of memory locations $03fe and $03ff. the i bit in the condition code register also is set. the mcu is configured to a known state during this type of reset, as described in section 5. resets . 4.5 software interrupt (swi) the swi is an executable instruction and a non-maskable interrupt since it is executed regardless of the state of the i bit in the ccr. if the i bit is 0 (interrupts enabled), the swi instruction executes after interrupts that were pending before the swi was fetched or before interrupts generated after the swi was fetched. the interrupt service routine address is specified by the contents of memory locations $03fc and $03fd. condition code register 1 1 1 pch 0 0 accumulator index register pcl r e t u r n decreasing memory addresses increasing memory addresses unstack stack i n t e r r u p t 0 0 0 0
interrupts hardware interrupts mc68hc05k3 revision 4.0 technical data motorola interrupts 43 4.6 hardware interrupts all hardware interrupts except reset are maskable by the i bit in the ccr. if the i bit is set, all hardware interrupts (internal and external) are disabled. clearing the i bit enables the hardware interrupts. the two types of hardware interrupts are explained here. 4.6.1 external interrupt ( irq) the irq pin provides an asynchronous interrupt to the cpu. a block diagram of the irq function is shown in figure 4-3 . the irq pin is one source of an irq interrupt, and a mask option is available to enable the four lower order port a pins (pa0Cpa3) to act as other irq interrupt sources. all of these sources are combined into a single oring function that is latched by the irq latch. the irq latch is set on the falling edge of the irq pin or on the rising edge of a pa0Cpa3 pin, if port a interrupts have been enabled by the mask option. figure 4-3. irq function block diagram latch r v dd irq pin i rqe irq sensitivity mask option irqf to irq processing in cpu irq vector fetch to bih & bil instruction sensing rst port a irq mask option pa0 pa1 pa2 pa3 irqr
technical data mc68hc05k3 revision 4.0 44 interrupts motorola interrupts if the mask option for edge-sensitive only irq is used, only the irq latch output can activate an irqf flag which creates a request to the cpu to generate the irq interrupt sequence. this makes the irq interrupt sensitive to these cases: ? if the port a interrupts are disabled by a mask option, only a falling edge on the irq pin initiates an irq interrupt. ? if the port a interrupts are enabled by a mask option, these conditions initiate an irq interrupt: C a falling edge on the irq pin with all the pa0Cpa3 pins at a low level C a rising edge on one pa0Cpa3 pin with all other pa0Cpa3 pins at a low level and the irq pin at a high level if the mask option for edge- and level-sensitive irq is used, the active high state of the irq latch input also can activate an irqf flag, which creates a request to the cpu to generate the irq interrupt sequence. this makes the irq interrupt sensitive to these cases: ? if the port a interrupts are disabled by a mask option, only these conditions initiate an irq interrupt: C a low level on the irq pin C falling edge on the irq pin ? if the port a interrupts are enabled by a mask option, these conditions initiate an irq interrupt: C a low level on the irq pin with all the pa0Cpa3 pins at a low level C falling edge on the irq pin with all the pa0Cpa3 pins at a low level C high level on any one of the pa0Cpa3 pins with the irq pin at a high level C rising edge on any pa0Cpa3 pin with all other pa0Cpa3 pins at a low level and the irq pin at a high level the irqe enable bit controls whether an active irqf flag can generate an irq interrupt sequence. this interrupt is serviced by the interrupt
interrupts hardware interrupts mc68hc05k3 revision 4.0 technical data motorola interrupts 45 service routine located at the address specified by the contents of $03fa and $03fb. entering the interrupt service routine automatically clears the irq latch. the irq interrupt service routine also may clear the irq latch by writing a logic 1 to the irqr acknowledge bit in the iscr. as long as the output state of the irqf flag bit is active, the cpu continuously re-enters the irq interrupt sequence following an rti instruction until the active state is removed or the irqe enable bit is cleared. 4.6.2 irq status/control register the irq interrupt function is controlled by the irq status/control register (iscr) located at $000a as shown in figure 4-4 . all unused bits in the iscr read as logic 0s. a reset clears the irqf bit and sets the irqe bit. irqr irq interrupt acknowledge bit the irqr acknowledge bit clears an irq interrupt request by clearing the irq latch. if the irq latch is set again while in the irq service routine (before an rti instruction is executed), the cpu re-enters the irq interrupt service routine unless the irq latch is cleared. writing a logic 1 to the irqr acknowledge bit clears the irq latch. writing a logic 0 to the irqr acknowledge bit has no effect on the irq latch. the irqr acknowledge bit always reads as a logic 0. address: $000a bit 7 654321 bit 0 read: irqe 0 0 0 irqf 0 0 0 write: r irqr reset: 10000000 = unimplemented r = reserved figure 4-4. irq status/control register (iscr)
technical data mc68hc05k3 revision 4.0 46 interrupts motorola interrupts irqf irq interrupt request bit the irqf flag bit indicates that an irq request is pending. writing to the irqf flag bit has no effect on it. the irqf flag bit is cleared automatically when the irq vector is fetched and the service routine is entered. the irqf flag bit also can be cleared by writing a logic 1 to the irqr acknowledge bit to clear the irq latch and also condition the external irq sources to be inactive if the edge- and level-sensitive mask option is selected. in this way, any additional setting of the irqf flag bit while in the service routine can be ignored by clearing the irqf flag bit just before exiting the service routine. if the irqf flag bit is set again while in the irq service routine, the cpu re-enters the irq interrupt sequence unless the irqf flag bit is cleared. the irqf flag bit is cleared by reset. irqe irq interrupt enable bit the irqe bit enables or disables the irqf flag bit to initiate an irq interrupt sequence. if the irqe enable bit is set, the irqf flag bit can generate an interrupt sequence. if the irqe enable bit is cleared, the irqf flag bit cannot generate an interrupt sequence. reset sets the irqe enable bit, thereby enabling irq interrupts once the i bit is cleared. execution of the stop or wait instructions causes the irqe bit to be set to allow the external irq to exit these modes. in addition, reset also sets the i bit, which masks all interrupt sources. note: if the i bit is cleared, any instruction that sets the irqe enable bit when the irqf flag bit is already set initiates an irq interrupt sequence immediately after that instruction. 4.6.3 port a interrupts (pa0Cpa3) the irq interrupt also can be triggered by inputs to pa0Cpa3 port pins as described in 4.6.1 external interrupt (irq) if the port interrupts mask option is used. if enabled, the lower four bits of port a can activate the irq interrupt function and the interrupt operation is the same as the input to the irq pin. the mask option allows all of these input pins to be ored with the input present on the irq pin. all pa0Cpa3 pins must be selected as a group and as an additional irq interrupt source. all the port a interrupt sources also are controlled by the irqe enable bit.
interrupts hardware interrupts mc68hc05k3 revision 4.0 technical data motorola interrupts 47 note: the bih and bil instructions apply only to the level on the irq pin itself and not to the output of the logic or gate with pa0Cpa3 pins. the state of the individual port a pins can be checked by reading the appropriate port a pins as inputs. note: if port a interrupts are enabled, the state of pa0Cpa3 pins may cause an irq interrupt regardless of whether these pins are configured as inputs or outputs. (see section 7. parallel input/output (i/o) .) 4.6.4 timer interrupt (timer) the timer interrupt is generated by the 8-bit timer when either a timer overflow or a real-time interrupt has occurred, as described in section 8. 8-bit timer . the interrupt flags and enable bits for the timer interrupts are in the timer status/control register (tscr) located at $0008. the i bit in the ccr must be clear for the timer interrupt to be enabled. either of these two interrupts vector to the same interrupt service routine located at the address specified by the contents of memory locations $03f8 and $03f9.
technical data mc68hc05k3 revision 4.0 48 interrupts motorola interrupts
mc68hc05k3 revision 4.0 technical data motorola resets 49 technical data mc68hc05k3 section 5. resets 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 5.3 external reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 5.4 internal resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 5.4.1 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 5.4.2 computer operating properly reset (copr) . . . . . . . . . . .51 5.4.3 illegal address reset (iladr) . . . . . . . . . . . . . . . . . . . . . . .51 5.2 introduction the mcu can be reset from four sources: one external input and three internal restart conditions. the reset pin is an input with a schmitt trigger, as shown in figure 5-1 . all the internal peripheral modules that drive external pins are reset by the synchronous reset signal (rst) coming from a latch, which is synchronized to the ph2 bus clock and set by any of the four reset sources. note: activation of the rst signal generally is referred to as a reset of the device, unless otherwise specified.
technical data mc68hc05k3 revision 4.0 50 resets motorola resets figure 5-1. reset block diagram 5.3 external reset ( reset) the reset pin is the only external source of a reset. this pin is connected to a schmitt trigger input gate to provide noise immunity. this external reset occurs whenever the reset pin is pulled low and remains in reset until the reset pin rises to a logic 1. this active low input generates the rst signal and resets the cpu and peripherals. 5.4 internal resets the three internally generated resets are: ? initial power-on reset (por) function ? computer operating properly (cop) watchdog timer reset ? illegal address detector reset (iladr) 5.4.1 power-on reset (por) the internal por is generated on power-up of the internal cpu to allow the clock oscillator to stabilize. the por is strictly for power turn-on conditions and is not able to detect a drop in the power supply voltage (a v dd rst illegal address (iladr) cpu latch reset cop watchdog reset (copr) osc data address ph2 to other peripherals s power-on reset (por) v dd address
resets internal resets mc68hc05k3 revision 4.0 technical data motorola resets 51 brown-out condition). after the oscillator becomes active, a mask option selects an oscillator stabilization delay of 16 or 4064 cycles of the internal processor bus clock (ph2). the por generates the rst signal that resets the cpu. if any other reset function is active at the end of this stabilization delay, the rst signal remains in the reset condition until the other reset condition(s) end(s). 5.4.2 computer operating properly reset (copr) a cop watchdog timer can be enabled by a mask option. the internal cop reset (copr) is generated automatically by a timeout of the cop watchdog timer. this timeout occurs if the counter in the cop watchdog timer is not reset (cleared) within a specific time by a user program reset sequence. refer to 8.4 cop watchdog timer for more information on this timeout feature. the copr generates the rst signal that resets the cpu and other peripherals. if any other reset function is active at the end of the copr reset signal, the rst signal remains in the reset condition until the other reset condition(s) end(s). the cop watchdog reset activates the internal pulldown device connected to the reset pin for one cycle of the internal processor bus clock, ph2. 5.4.3 illegal address reset (iladr) the internal iladr reset is generated when an instruction opcode fetch occurs from an address in the i/o address area ($0000C$001f). the iladr generates the rst signal that resets the cpu and other peripherals. if any other reset function is active at the end of the iladr reset signal, the rst signal remains in the reset condition until the other reset condition(s) end(s). the iladr reset activates the internal pulldown device connected to the reset pin for one cycle of the internal processor bus clock, ph2.
technical data mc68hc05k3 revision 4.0 52 resets motorola resets
mc68hc05k3 revision 4.0 technical data motorola operational modes 53 technical data mc68hc05k3 section 6. operational modes 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.3 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.3.1 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 6.3.2 halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 6.3.3 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 6.3.4 cop watchdog timer considerations . . . . . . . . . . . . . . . . .57 6.4 peeprom serial programming mode . . . . . . . . . . . . . . . . . . .57 6.2 introduction the mc68hc05k3 is capable of running in one of several operational modes. these modes include: ? low-power operational modes C stop mode C wait mode C halt mode ? serial program mode 6.3 low-power modes the wait and stop/halt instructions provide two low-power operational modes that reduce the power required for the mcu by stopping various internal clocks and/or the on-chip oscillator. the flow of the stop, halt, and wait modes is shown in figure 6-1 .
technical data mc68hc05k3 revision 4.0 54 operational modes motorola operational modes 6.3.1 stop mode the stop instruction can result in one of two modes of operation depending on its mask option. the mask option can make the stop instruction operate the same as the stop instruction in other m68hc05 family members and place the device in stop mode. or the mask option can make the stop instruction behave like a wait instruction (except that the restart time involves a delay) and place the device in halt mode. the mask option enabling the execution of the stop instruction places the mcu in its lowest power consumption mode. in stop mode, the internal oscillator is turned off, halting all internal processing, including the cop watchdog timer. when the cpu enters stop mode, the interrupt flags (tof and rtif) and the interrupt enable bits (tofe and rtie) in the tscr are cleared by internal hardware to remove any pending timer interrupt requests and to disable any further timer interrupts. execution of the stop instruction automatically clears the i bit in the condition code register and sets the irqe enable bit in the irq status/control register so that the irq external interrupt is enabled. all other memory and registers, including the other bits in the tscr, remain unaltered. the mcu can be brought out of stop mode only by an irq external interrupt, an irq from port a (if mask option is enabled), or an externally generated reset. when exiting stop mode, the internal oscillator resumes after an oscillator stabilization delay of either 16 or 4064 cycles (depending on mask option state) of the internal processor clock. note: if enabled by a mask option, the stop instruction causes the oscillator to stop and, therefore, disable the cop watchdog timer. if the cop watchdog timer is used and the part is never intended to enter stop mode, the mask option that should be used is the one that disables the stop instruction and changes the stop mode to the halt mode. see 6.3.4 cop watchdog timer considerations for more details.
operational modes low-power modes mc68hc05k3 revision 4.0 technical data motorola operational modes 55 figure 6-1. stop/halt/wait flowcharts 1. fetch reset vector or 2. service interrupt a. stack cpu state b. set i bit c. vector to interrupt routine wait external reset? y n irq external interrupt? y n stop external oscillator, stop internal timer clock, and reset startup delay restart external oscillator and begin stabilization delay stop internal processor clock, clear i bit in ccr, and set irqe in iscr end of startup delay? y n irq external interrupt? y n external oscillator active and internal timer clock active restart internal processor clock stop internal processor clock, clear i bit in ccr, and set irqe in iscr timer internal interrupt? y n external reset? y n stop halt external reset? y n irq external interrupt? y n stop internal processor clock, clear i bit in ccr, and set irqe in iscr external oscillator active and internal timer clock active timer internal interrupt? y n mask option to halt? y n
technical data mc68hc05k3 revision 4.0 56 operational modes motorola operational modes 6.3.2 halt mode execution of the stop instruction with a mask option to disable the stop mode places the mcu in a low-power halt mode, which consumes more power than stop mode. in halt mode, the internal processor clock is halted, suspending all processor and internal bus activity. internal timer clocks remain active, permitting interrupts to be generated from the timer or a reset to be generated from the cop watchdog timer. execution of the stop instruction in the halt mode automatically clears the i bit in the condition code register and sets the irqe enable bit in the irq status/control register so that the irq external interrupt is enabled. all other registers, memory, and input/output lines remain in their previous states. if timer interrupts are enabled, a timer interrupt causes the processor to exit halt mode and resume normal operation. halt mode also can be exited when an external irq or external reset occurs. when exiting halt mode, the internal processor clock resumes after a variable delay. depending on the mask option state, the maximum oscillator stabilization delay is 16 or 4064 cycles of the internal processor clock. using the mask option to disable the stop instruction prevents the stop instruction from halting the oscillator or affecting the cop watchdog timer similar to wait mode. however, the recovery method introduces some startup delay in the processor clock. note: halt mode is not intended for normal use, but is provided to keep the cop watchdog timer active if the stop instruction opcode is executed inadvertently. 6.3.3 wait mode the wait instruction places the mcu in a low-power wait mode, which consumes more power than stop mode. in wait mode, the internal processor clock is halted, suspending all processor and internal bus activity. internal timer clocks remain active, permitting interrupts to be generated from the timer or a reset to be generated from the cop watchdog timer. execution of the wait instruction automatically clears the i bit in the condition code register and sets the irqe enable bit in the
operational modes peeprom serial programming mode mc68hc05k3 revision 4.0 technical data motorola operational modes 57 irq status/control register so that the irq external interrupt is enabled. all other registers, memory, and input/output lines remain in their previous states. if timer interrupts are enabled, a timer interrupt causes the processor to exit wait mode and resume normal operation. thus, the timer can be used to generate a periodic exit from wait mode. wait mode also is exited when an external irq or reset occurs. 6.3.4 cop watchdog timer considerations if the cop watchdog timer is enabled by the mask option, any execution of the stop instruction (either intentional or inadvertent due to the cpu being disturbed) causes the oscillator to halt and prevent the cop watchdog timer from timing out unless the stop instruction is disabled by a mask option. if the mask option is selected to enable the cop watchdog timer, the cop resets the mcu when it times out. therefore, it is recommended that the mask option be selected to disable the cop watchdog for a system that must have intentional uses of the wait mode for periods longer than the cop timeout period. 6.4 peeprom serial programming mode the internal personality eeprom (peeprom) can be erased, read, or programmed through the application of serial data patterns to the irq and pb0 pins, if the peeprom serial programming mode is selected following reset. refer to 9.6 peeprom serial programming for details.
technical data mc68hc05k3 revision 4.0 58 operational modes motorola operational modes
mc68hc05k3 revision 4.0 technical data motorola parallel input/output (i/o) 59 technical data mc68hc05k3 section 7. parallel input/output (i/o) 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7.3.1 port a data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 7.3.2 port a data direction register . . . . . . . . . . . . . . . . . . . . . . .61 7.3.3 port a pulldown inhibit register. . . . . . . . . . . . . . . . . . . . . .61 7.3.4 port a light-emitting diode (led) drive capability . . . . . . .62 7.3.5 port a i/o pin interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 7.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 7.4.1 port b data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 7.4.2 port b data direction register . . . . . . . . . . . . . . . . . . . . . . .65 7.4.3 port b pulldown inhibit register. . . . . . . . . . . . . . . . . . . . . .65 7.4.4 port b with 3-pin rc oscillator . . . . . . . . . . . . . . . . . . . . . .66 7.5 i/o port programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 7.5.1 pin data direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 7.5.2 output pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 7.5.3 input pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 7.5.4 i/o pin transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 7.5.5 i/o pin truth tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68
technical data mc68hc05k3 revision 4.0 60 parallel input/output (i/o) motorola parallel input/output (i/o) 7.2 introduction in single-chip mode, 10 bidirectional input/output (i/o) lines are arranged as one 8-bit i/o port (port a) and one 2-bit i/o port (port b). the individual bits in these ports are programmable as either inputs or outputs under software control by the data direction registers (ddrs). all port a and port b i/o pins have individual software programmable pulldown devices which can be enabled by a mask option. some port a pins also have the additional properties of sinking higher current or acting as additional irq interrupt input sources. one of the port b pins also may be used as an output for a 3-pin resistor capacitor (rc) oscillator option. 7.3 port a port a is an 8-bit bidirectional port that shares four of its pins with the irq interrupt system, as shown in figure 7-1 . each port a pin is controlled by the corresponding bits in a data direction register, a data register, and a pulldown register. figure 7-1. port a i/o circuitry write $0010 read $0000 write $0000 read $0004 data register bit to irq interrupt system (bits 0-3 only) i/o pin output mask option to inhibit software pulldowns internal hc05 data bus reset (rst) write $0004 data direction register bit pulldown register bit v dd
parallel input/output (i/o) port a mc68hc05k3 revision 4.0 technical data motorola parallel input/output (i/o) 61 the port a data register is located at address $0000. the port a data direction register (ddra) is located at address $0004. the port a pulldown register (pdra) is located at address $0010. reset clears both the ddra and the pdra. the port a data register is unaffected by reset. 7.3.1 port a data register each port a i/o pin has a corresponding bit in the port a data register. when a port a pin is programmed as an output, the state of the corresponding data register bit determines the state of the output pin. when a port a pin is programmed as an input, any read of the port a data register returns the logic state of the corresponding i/o pin, and any write to the port a data register is saved in the data register, but is not applied to the corresponding i/o pin. the port a data register is unaffected by reset. the port a data register is indeterminant after initial power-up. 7.3.2 port a data direction register each port a i/o pin may be programmed as an input by clearing the corresponding bit in the ddra or programmed as an output by setting the corresponding bit in the ddra. when a ddra bit is set, the corresponding pulldown device is disabled. the ddra can be accessed at address $0004. the ddra is cleared by reset. 7.3.3 port a pulldown inhibit register all port a i/o pins have software programmable pulldown devices which may be enabled by a mask option. if enabled by mask option, the software programmable pulldowns are activated by clearing their corresponding bit in the pdra or disabled by setting the corresponding bit in the pdra. if disabled by a mask option, all pulldowns are disabled. a pulldown on an i/o pin can be activated only if the i/o pin is programmed as an input.
technical data mc68hc05k3 revision 4.0 62 parallel input/output (i/o) motorola parallel input/output (i/o) the pdra is a write-only register and any reads of location $0010 return undefined results. since reset clears both the ddra and the pdra, all pins initialize as inputs with the pulldown devices active (if enabled by mask option). 7.3.4 port a light-emitting diode (led) drive capability the outputs of port a pins 4C7 are capable of sinking high current for light-emitting diode (led) drive capability. 7.3.5 port a i/o pin interrupts the inputs for the lower four bits of port a can be connected through an or gate to the irq latched input to the cpu by a mask option. when connected as an alternate source of an irq interrupt, the port a input pins behave the same as the irq pin itself, except that their active state is a logic 1 or a rising edge. the normal irq pin has an active state that is a logic 0 or a falling edge depending on the mask option. if the mask option for edge- and level-sensitive interrupts and the mask option for port a interrupts are both used, the presence of a logic 1 on any one of the lower four port a pins causes an irq interrupt request. if the mask option for edge-sensitive-only interrupts and the mask option for port a interrupts are both used, the occurrence of a rising edge on any one of the pa0Cpa3 pins causes an irq interrupt request, as long as the other pa0Cpa3 pins are at a low level. as long as any one of the pa0Cpa3 irq inputs remains at a logic 1 level, or the irq remains at a logic 0 level, the other pa0Cpa3 irq inputs are effectively ignored. port address: $0010 bit 7 654321 bit 0 read: write: pdia7 pdia6 pdia5 pdia4 pdia3 pdia2 pdia1 pdia0 reset: 00000000 = unimplemented figure 7-2. port a pulldown inhibit register (pdra)
parallel input/output (i/o) port b mc68hc05k3 revision 4.0 technical data motorola parallel input/output (i/o) 63 interrupts will be generated with the above pa0Cpa3 i/o state regardless of whether the port is configured as an input or output. note: the bih and bil instructions apply only to the level on the irq pin itself and not to the internal irq input to the cpu. therefore, bih and bil cannot be used to test the state of the lower four port a input pins as a group. each port a interrupt pin can be tested by reading the port a data register at $0000. 7.4 port b port b is a 2-bit bidirectional port that shares one of its pins with the rc oscillator as shown in figure 7-3 . each port b pin is controlled by the corresponding bits in a data direction register, a data register, and a pulldown register. the port b data register is located at address $0001. the port b data direction register (ddrb) is located at address $0005, and the port b pulldown register (pdrb) is located at address $0011. reset clears both the ddrb and the pdrb. the port b data register is unaffected by reset. the port b data register is indeterminant after initial powerup. 7.4.1 port b data register each port b i/o pin has a corresponding bit in the port b data register. when a port b pin is programmed as an output, the state of the corresponding data register bit determines the state of the output pin. when a port b pin is programmed as an input, any read of the port b data register returns the logic state of the corresponding i/o pin, and any write to the port b data register is saved in the data register, but is not applied to the corresponding i/o pin. unused bits 2C7 are always read as logic 0s, and any write to these bits is ignored. the port b data register is unaffected by reset. the port b data register is indeterminant after initial power-up.
technical data mc68hc05k3 revision 4.0 64 parallel input/output (i/o) motorola parallel input/output (i/o) figure 7-3. port b i/o circuitry write $0011 read $0001 write $0001 read $0005 write $0005 write $0001 read $0001 read $0005 write $0005 mask option for rc oscillator from 3-pin rc oscillator internal hc05 data bus pb1 osc3 i/o pin data register bit output data direction register b mask option for 3-pin rc oscillator data register bit pb0 pin output mask option to inhibit software pulldowns reset (rst) data direction register bit pulldown register bit write $0011 pulldown register bit v dd
parallel input/output (i/o) port b mc68hc05k3 revision 4.0 technical data motorola parallel input/output (i/o) 65 7.4.2 port b data direction register each port b i/o pin may be programmed as an input by clearing the corresponding bit in the ddrb or programmed as an output by setting the corresponding bit in the ddrb. when a ddrb bit is set, the corresponding pulldown device is disabled. the ddrb can be accessed at address $0005. unused bits 2C7 are always read as logic 0s, and any write to these bits is ignored. the ddrb is cleared by reset. 7.4.3 port b pulldown inhibit register each port b i/o pin has a software programmable pulldown device which can be enabled by a mask option. if enabled by a mask option, the software programmable pulldowns are activated by clearing the corresponding bit in the pdrb or disabled by setting the corresponding bit in the pdrb. if disabled by a mask option, all pulldowns are disabled. a pulldown on an i/o pin can be activated only if the i/o pin is programmed as an input. the pdrb is a write-only register and any reads of location $0011 return undefined results. since reset clears both the ddrb and the pdrb, all pins initialize as inputs with the pulldown devices active (if enabled by mask option). address: $0011 bit 7 654321 bit 0 read: write: pdib1 pdib0 reset: 0 0 = unimplemented figure 7-4. port b pulldown inhibit register (pdrb)
technical data mc68hc05k3 revision 4.0 66 parallel input/output (i/o) motorola parallel input/output (i/o) 7.4.4 port b with 3-pin rc oscillator the pb1/osc3 pin may be used as an output from a 3-pin rc oscillator when the mask option for a 3-pin rc oscillator is used. in this case, the following conditions apply: ? the pb1 data register bit can be used as a read/write storage location without affecting the oscillator. pb1 is unaffected by reset. ? the ddrb1 data direction bit can be used as a read/write storage location without affecting the oscillator. ddrb1 is cleared by reset. ? the software programmable pulldown on pb1/osc3 is disabled, regardless of the mask option selection for the software programmable pulldowns or the state of pdrb1. 7.5 i/o port programming all i/o pins can be programmed as inputs or outputs, with or without pulldown devices. 7.5.1 pin data direction the direction of a pin is determined by the state of its corresponding bit in the associated port data direction register (ddr). a pin is configured as an output if its corresponding ddr bit is set to a logic 1. a pin is configured as an input if its corresponding ddr bit is cleared to a logic 0. the data direction bits ddrb0, ddrb1, and ddra0Cddra7 are read/write bits that can be manipulated with read-modify-write instructions. at power-on or reset, all ddrs are cleared, which configures all port pins as inputs. if the mask option for software programmable pulldowns is selected, all pins initially power-up with their software programmable pulldowns enabled.
parallel input/output (i/o) i/o port programming mc68hc05k3 revision 4.0 technical data motorola parallel input/output (i/o) 67 7.5.2 output pin when an i/o pin is programmed as an output pin, the state of the corresponding data register bit determines the state of the pin. the state of the data register bits can be altered by writing to address $0000 for port a and address $0001 for port b. reads of the corresponding data register bit at address $0000 or $0001 return the state of the data register bit, not the state of the i/o pin itself. therefore, bit manipulation is possible on all pins programmed as outputs. all pins programmed as outputs have their pulldown devices disabled regardless of the selected mask option for software programmable pulldowns or the state of their pdr bits. 7.5.3 input pin when an i/o pin is programmed as an input pin, the state of the pin can be determined by reading the corresponding data register bit. any writes to the corresponding data register bit for an input pin is saved by the register bit, but not applied to the corresponding i/o pin until the pin is later programmed to be an output. if the corresponding bit in the pulldown register is clear (and the mask option for software programmable pulldowns is selected), the input pin also has an activated pulldown device. read-modify-write instructions, such as bit manipulation, should not be used on the pulldown registers, since they are write-only. 7.5.4 i/o pin transitions a glitch can be generated on an i/o pin when changing it from an input to an output unless the data register is first pre-conditioned to the desired state before changing the corresponding ddr bit from a 0 to a 1.
technical data mc68hc05k3 revision 4.0 68 parallel input/output (i/o) motorola parallel input/output (i/o) if the mask option for software programmable pulldowns is selected, a floating input can be avoided by first clearing the pulldown register bit before changing the corresponding ddr from a 1 to a 0. this ensures that the pulldown device is activated on the pin as the i/o pin changes from a driven output to a pulled low input. 7.5.5 i/o pin truth tables every pin on port a and pb0 on port b may be programmed as an input or an output under software control, as shown in table 7-1 and table 7-2 . all port i/o pins also may have software programmable pulldown devices selected by a mask option. the pb1/osc3 pin on port b also can be programmed as an input or an output under software control, but it has special considerations when selected by a mask option as an output for the 3-pin rc oscillator, as shown in table 7-3 . otherwise, pb1/osc3 behaves the same as pb0. table 7-1. port a pin functions software prog. pulldown mask option* pdiax ddrax i/o pin mode access to pdra at $0010 access to ddra at $0004 access to data register at $0000 read write read/write read write 1 x 0 in, hi-z u pdia0Cpdia7 ddra0Cddra7 i/o pin x 1 x 1 out u pdia0Cpdia7 ddra0Cddra7 pa0Cpa7 pa0Cpa7 000 in, pulldown u pdia0Cpdia7 ddra0Cddra7 i/o pin x 0 0 1 out u pdia0Cpdia7 ddra0Cddra7 pa0Cpa7 pa0Cpa7 0 1 0 in, hi-z u pdia0Cpdia7 ddra0Cddra7 i/o pin x 0 1 1 out u pdia0Cpdia7 ddra0Cddra7 pa0Cpa7 pa0Cpa7 notes: x is dont care state u is an undefined state *1 = pulldowns disabled, 0 = pulldowns enabled
parallel input/output (i/o) i/o port programming mc68hc05k3 revision 4.0 technical data motorola parallel input/output (i/o) 69 table 7-2. pb0 pin functions software prog. pulldown mask option* pdib0 ddrb0 i/o pin mode access to pdrb at $0011 access to ddrb at $0005 access to data register at $0001 read write read/write read write 1 x 0 in, hi-z u pdib0 ddrb0 i/o pin x 1 x 1 out u pdib0 ddrb0 pb0 pb0 0 0 0 in, pulldown u pdib0 ddrb0 i/o pin x 0 0 1 out u pdib0 ddrb0 pb0 pb0 0 1 0 in, hi-z u pdib0 ddrb0 i/o pin x 0 1 1 out u pdib0 ddrb0 pb0 pb0 notes: x is dont care state u is an undefined state *1 = pulldowns disabled, 0 = pulldowns enabled table 7-3. pb1/osc3 pin functions mask option (3-pin) software prog. pulldown mask option* pdib1 ddrb1 i/o pin mode access to pdrb at $0011 access to ddrb at $0005 access to data register at $0001 read write read/write read write 0 0 1 0 in, hi-z u pdib1 ddrb1 i/o pin x 0 0 1 1 out u pdib1 ddrb1 pb1 pb1 0000 in, pulldown u pdib1 ddrb1 i/o pin x 0 0 0 1 out u pdib1 ddrb1 pb1 pb1 0 0 0 0 in, hi-z u pdib1 ddrb1 i/o pin x 0 0 0 1 out u pdib1 ddrb1 pb1 pb1 1xxx rc oscout u pdib1 ddrb1 pb1 pb1 notes: x is dont care state u is an undefined state *1 = pulldowns disabled, 0 = pulldowns enabled
technical data mc68hc05k3 revision 4.0 70 parallel input/output (i/o) motorola parallel input/output (i/o)
mc68hc05k3 revision 4.0 technical data motorola 8-bit timer 71 technical data mc68hc05k3 section 8. 8-bit timer 8.1 contents 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 8.3 timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 8.3.1 timer counter register . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 8.3.2 timer status/control register . . . . . . . . . . . . . . . . . . . . . . .74 8.4 cop watchdog timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 8.5 operating during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . .77 8.6 operating during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . .77 8.2 introduction the timer for this device is an 8-bit ripple counter. the features include timer overflow (tof), power-on reset (por), real-time interrupt (rti), and computer operating properly (cop) watchdog timer. this timer is powered down in the stop mode to reduce stop i dd . as shown in figure 8-1 , the timer is driven by the timer clock, ntf1, divided by four (4). ntf1 has the same phase and frequency as the processor bus clock, ph2, but is not stopped by the wait or halt modes. this signal drives an 8-bit ripple counter. the value of this 8-bit ripple counter can be read by the cpu at any time by accessing the timer counter register (tcntr) at address $09. a timer overflow function is implemented on the last stage of this counter, giving a possible interrupt at the rate of f op /1024. two additional stages produce the por function at f op /4064 or f op /16, followed by two more stages, with the resulting clock (f op /16,384) driving the real-time interrupt (rti) circuit. the rti circuit consists of three divider stages with a one-of-four selector. the output of the rti circuit is further divided by eight to drive
technical data mc68hc05k3 revision 4.0 72 8-bit timer motorola 8-bit timer the optional cop watchdog timer circuit, which can be enabled by a mask option. the rti rate selector bits and the rti and tof enable bits and flags are located in the timer control and status register at location $08. the clock frequency that drives the rti circuit is f op /2 14 (or f op /16,384) with three additional divider stages giving a maximum interrupt period of f op /2 17 (or f op /131,072). the power-on cycle clears the entire counter chain and begins clocking the counter. after 4064 or 16 cycles (depending on mask option), the power-on reset circuit is released, which again clears the counter chain and allows the device to come out of reset. at this point, if reset is not asserted, the timer starts counting up from 0 and normal device operation begins. if reset is asserted at any time during operation, the counter chain is cleared. figure 8-1. timer block diagram copr clear mc68hc05 internal bus $09 tcntr 7-bit counter interrupt circuit $08 tscr rti select circuit overflow circuit detect cop watchdog timer to reset logic to interrupt logic 8 8 f op /2 2 f op /2 10 por tcbp tscr tcntr ntf1 internal timer clock ( f op ) tof rtif tofe rtie rt1 rt0 rtifr tofr timer status/control register timer counter register (tcntr) ? 4 ? 8 reset mor1,2 refresh
8-bit timer timer registers mc68hc05k3 revision 4.0 technical data motorola 8-bit timer 73 8.3 timer registers the 8-bit timer contains two registers: ? timer counter register ? timer status/control register 8.3.1 timer counter register the timer counter register is a read-only register that contains the current value of the 8-bit ripple counter at the beginning of the timer chain. this counter is clocked at f op divided by 4 and can be used for various functions including a software input capture. extended time periods can be attained using the tof function to increment a temporary ram storage location thereby simulating a 16-bit (or more) counter. the value of each bit of the tcntr is shown in figure 8-2 . this register is cleared by reset. address: $0009 bit 7 654321 bit 0 read: tcr7 tcr6 tcr5 tcr4 tcr3 tcr2 tcr1 tcr0 write: reset: 00000000 = unimplemented figure 8-2. timer counter register (tcntr)
technical data mc68hc05k3 revision 4.0 74 8-bit timer motorola 8-bit timer 8.3.2 timer status/control register the tscr contains the timer interrupt flag, the timer interrupt enable bits, and the real-time interrupt rate select bits. bit 2 and bit 3 are write-only bits that read as logical 0s. figure 8-3 shows the value of each bit in the tscr following reset. tof timer overflow bit the tof is a read-only flag bit that is set when the 8-bit ripple counter rolls over from $ff to $00. a timer interrupt request is generated if tof is set when toie is also set. the tof flag bit is reset by writing a logical 1 to the tofr acknowledge bit. writing to the tof flag bit has no effect on its value. this bit is cleared by reset. rtif real-time interrupt flag bit the rtif is a read-only flag bit that is set when the output of the chosen (one-of-four selection) real-time interrupt stage goes active. a timer interrupt request is generated if rtif is set when rtie is also set. the rtif flag bit is reset by writing a logical 1 to the rtifr acknowledge bit. writing to the rtif flag bit has no effect on its value. this bit is cleared by reset. toie timer overflow interrupt enable bit the toie is an enable bit that allows generation of a timer interrupt. when the toie enable bit is set, the timer interrupt is generated when the tof flag bit is set. this bit is cleared by reset. address: $0008 bit 7 654321 bit 0 read: tof rtif toie rtie 00 rt1 rt0 write: tofr rtifr reset: 00000011 = unimplemented figure 8-3. timer status/control register (tscr)
8-bit timer timer registers mc68hc05k3 revision 4.0 technical data motorola 8-bit timer 75 rtie real-time interrupt enable bit the rtie is an enable bit that allows the generation of a timer interrupt. when the rtie enable bit is set and the rtif flag bit is set, the timer interrupt is generated. the rtie bit is cleared by reset. tofr timer overflow acknowledge bit the tofr is an acknowledge bit that resets the tof flag bit. writing a logical 1 to the tofr clears the tof flag bit. reading the tofr always returns a logical 0. this bit is unaffected by reset. rtifr real-time interrupt acknowledge bit the rtifr is an acknowledge bit that resets the rtif flag bit. writing a logical 1 to the rtifr clears the rtif flag bit. reading the rtifr always returns a logical 0. this bit is unaffected by reset. rt1:rt0 real-time interrupt rate select bit the rt0 and rt1 control bits select one-of-four taps for the real-time interrupt circuit. table 8-1 shows the available interrupt rates with several f op values. both the rt0 and rt1 control bits are set by reset, selecting the lowest periodic rate and therefore the maximum time in which to alter these bits if necessary. care should be taken when altering rt0 and rt1 if the time-out period is imminent or uncertain. if the selected tap is modified during a cycle in which the counter is switching, an rtif can be missed or an additional rtif can be generated. to avoid problems, the cop should be cleared just prior to changing rti taps. table 8-1. rti rates and cop reset times rt1 and rt0 rti rate rti period (f op = 2 mhz) cop timeout period ( 1 rti period) minimum cop timeout period (f op = 2 mhz) 00 f op ? 2 14 8.2 ms 8 x rti period 57.3 ms 01 f op ? 2 15 16.4 ms 8 x rti period 114.7 ms 10 f op ? 2 16 32.8 ms 8 x rti period 229.4 ms 11 f op ? 2 17 65.5 ms 8 x rti period 458.8 ms
technical data mc68hc05k3 revision 4.0 76 8-bit timer motorola 8-bit timer 8.4 cop watchdog timer the computer operating properly (cop) watchdog timer function is implemented on this device by using the output of the rti circuit and further dividing it by eight. the minimum cop reset times are listed in table 8-1 . if the cop circuit times out, an internal reset is generated and the reset vector is fetched. preventing a cop timeout is done by writing a logical 0 to the copc bit at address $03f0 as shown in figure 8-4 . the copr register is shared with a user eeprom byte. this address location is not affected by any reset signals. reading this location returns the user eeprom byte. when the copc is cleared, only the final four bits used to count eight rti cycles are cleared. the cop watchdog timer can be enabled/disabled by a mask option. address: $03f0 bit 7 654321 bit 0 read: reading $03f0 returns the contents of user eeprom write: copc reset: 0 = unimplemented figure 8-4. copr watchdog timer location
8-bit timer operating during stop mode mc68hc05k3 revision 4.0 technical data motorola 8-bit timer 77 8.5 operating during stop mode the timer system is cleared when going into stop mode. when stop is exited by an external interrupt or an external reset, the internal oscillator resumes, followed by a 16- or 4064-cycle internal processor oscillator stabilization delay. the timer system counter is then cleared and operation resumes. if the stop instruction is disabled by mask option to create the halt mode, the effects on the timer are as described in 8.6 operating during wait mode . 8.6 operating during wait mode the cpu clock halts during wait mode, but the timer remains active. if interrupts are enabled, a timer interrupt or custom periodic interrupt causes the processor to exit wait mode.
technical data mc68hc05k3 revision 4.0 78 8-bit timer motorola 8-bit timer
mc68hc05k3 revision 4.0 technical data motorola personality eeprom (peeprom) 79 technical data mc68hc05k3 section 9. personality eeprom (peeprom) 9.1 contents 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.3 peeprom registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 9.3.1 peeprom bit select register. . . . . . . . . . . . . . . . . . . . . . .81 9.3.2 peeprom status/control register . . . . . . . . . . . . . . . . . . .82 9.4 peeprom programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 9.5 peeprom read access . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 9.6 peeprom serial programming . . . . . . . . . . . . . . . . . . . . . . . .87 9.6.1 serial programming connections. . . . . . . . . . . . . . . . . . . . .87 9.6.2 multiple devices in serial program mode . . . . . . . . . . . . . .88 9.6.3 peeprom serial programming mode entry . . . . . . . . . . . .89 9.7 serial programming sequence. . . . . . . . . . . . . . . . . . . . . . . . .91 9.8 serial data readout sequence . . . . . . . . . . . . . . . . . . . . . . . .95 9.9 serial bulk erase sequence . . . . . . . . . . . . . . . . . . . . . . . . . . .96 9.2 introduction the mc68hc05k3 contains a 128-bit personality eeprom (peeprom) for storage of variables or user data. these 128 bits are provided as a simple eeprom array and control logic that requires serial reading of the data. the peeprom may be accessed via software programmed into the user rom through two registers that directly interface with the peeprom array. the actual implementation of the software varies depending on customer requirements. the peeprom array is arranged as 16 bytes (rows) with a separate column select for each bit (column) in a byte. the column select connects the bit to a
technical data mc68hc05k3 revision 4.0 80 personality eeprom (peeprom) motorola personality eeprom (peeprom) single sense amplifier as shown in the block diagram of the peeprom module in figure 9-1 . an on-chip charge pump is provided to allow programming and erasure of the personality eeprom if the supply voltage to the v dd pin is at least 2.7 vdc. note: programming and erasure of the personality eeprom may only be performed if v dd greater than or equal to 2.7 vdc. figure 9-1. personality eeprom block diagram internal ring oscillator v dd 16-to-1 decode & mux 8-to-1 decode & mux v pp switch single sense amp personality eeprom bit select register personality eeprom status/control register pedata pepgm/pebyte/pebulk 0-2 8 8 hc05 data bus 16 x 8 eeprom array v pp switch 3-6 on-chip charge pump cpen pepczf each row is a byte cpclk mux bus clock (ph2)
personality eeprom (peeprom) peeprom registers mc68hc05k3 revision 4.0 technical data motorola personality eeprom (peeprom) 81 9.3 peeprom registers two register locations are used to support the eeprom array. these are the bit select and status/control registers. 9.3.1 peeprom bit select register the peeprom bit select register (pebsr) is located at $000e and contains the enable signals for the rows and columns to access the bits in the eeprom array. figure 9-2 shows the placement of these bits. the output of this register is connected to two decoders, one for the array column and one for the array row. a byte in the peeprom is defined by the upper four bits in the 7-bit address in the pebsr (peb3Cpeb6) and the bit within that byte is defined by the lower three bits in the 7-bit address in the pebsr (peb0Cpeb2). the upper bit in the pebsr (peb7) may be used as a storage location. all of the bits in the pebsr register are cleared by reset. address: $000e byte (row) of peeprom bit (column in byte (row) of peeprom 3210210 bit 7 654321 bit 0 read: peb7 peb6 peb5 peb4 peb3 peb2 peb1 peb0 write: reset: 00000000 figure 9-2. peeprom bit select register (pebsr)
technical data mc68hc05k3 revision 4.0 82 personality eeprom (peeprom) motorola personality eeprom (peeprom) 9.3.2 peeprom status/control register the peeprom status/control register (pescr) is located at $000f and contains five user bits, as shown in figure 9-3 . bit 1 is unimplemented and always reads as a logic 0. the states of all bits except pepczf and pedata are cleared by reset. the pepczf is set by reset; and the state of the pedata bit following reset is dependent on the stored data in bit 0 of the peeprom array. pepczf peeprom column zero flag bit the pepczf is a flag bit that is set to a logical 1 when the first column (col0) of the eeprom array is selected. if any other column is selected, the pepczf flag bit is cleared. this flag bit can be used to reduce the software code required to access one byte of the peeprom. the pepczf is set following a reset, since the first column is selected by the reset of the pebsr. the software code given in table 9-1 is suggested for reading one byte from the peeprom. address: $000f bit 7 6 5 4321 bit 0 read: pedata pebulk pepgm (data in) pebyte cpen cpclk 0 pepczf write: reset: 10000001 = unimplemented figure 9-3. peeprom status/control register (pescr)
personality eeprom (peeprom) peeprom registers mc68hc05k3 revision 4.0 technical data motorola personality eeprom (peeprom) 83 table 9-1. software to read peeprom pebsr equ $000e pescr equ $000f ram equ $000c lda #$xy ; xy is base addresses and should start on sta pebsr ; a first column (i.e., $00, $08, $10, $18, etc). clr ram ; clear ram location used for final result peep_rd rol pescr ; c = pedata (c = carry bit) ror ram ; ram = c inc pebsr ; go to next bit in array. brclr 0,pescr,peep_rd ; care data here, loop until all bytes read ; peep_rd loop ends when pepczf = 1. ; at end of loop, ram contains one row of peep data. cpclk charge pump clock source bit the cpclk bit is a read/write bit that controls the source of the clock for the charge pump. when the cpclk bit is set, the charge pump is driven by the ph2 bus clock. when the cpclk bit is cleared, the charge pump is driven from an internal ring oscillator. the cpclk bit is cleared when the device is in reset. in systems where the desired ph2 clock rate is below 1 mhz, the cpclk bit should be cleared to enable the internal ring oscillator. otherwise, the charge pump does not attain sufficient program/erase voltage because the clock source is too slow. cpen charge pump enable bit the cpen bit is a read/write bit to control the on-chip charge pump for programming and erasure of the personality eeprom. this charge pump is only intended for use at v dd supply voltages greater than or equal to 2.7 vdc. the charge pump is activated when both the cpen bit is set and one of the program or erase bits is also set (pepgm, pebyte, or pbulk). the charge pump supplies the required programming voltage to the personality eeprom array. once activated, and after startup time t cp , the charge pump continues to operate until all the program and erase bits are cleared. note: if the personality eeprom is read while the cpen bit is set, the data is unknown.
technical data mc68hc05k3 revision 4.0 84 personality eeprom (peeprom) motorola personality eeprom (peeprom) the charge pump must always be used to program or erase bits in the personality eeprom. the cpen bit is cleared when the device is in reset. note: setting the cpen bit can activate the charge pump. however, all the pepgm, pebyte, pebulk, and cpen bits must be cleared to de-activate the charge pump. if the charge pump is left running, the overall device i dd current increases. pebyte peeprom byte erase bit the pebyte bit is a read/write bit to control the switches that apply the internally provided charge pump programming voltage to a row in the peeprom array that is to be erased. when the pebyte bit is set to a logical 1, a logical 0 is stored to all bits in the same row of the peeprom array, as specified by the upper four bits of the 7-bit address in the pebsr. the pebyte bit should only be set if the pepgm and pebulk bits are cleared. if both the pebyte and pebulk bits are set, the peeprom is bulk erased. the pebyte bit is cleared when the device is reset. pepgm peeprom program control bit the pepgm bit is a read/write bit to control the switches that apply the internally provided charge pump programming voltage to the device in the peeprom array that is to be programmed. when the pepgm bit is set to a logical 1, a logical 1 is stored to the peeprom array element specified by the address in the pebsr. since the state of the pepgm bit determines the state of the programmed bit in the peeprom array, the pepgm bit is similar to a data in bit. the pepgm bit should be set only if the pebyte and pebulk bits are cleared. the pepgm bit is cleared when the device is reset. note: only one of the pepgm, pebyte, or pebulk bits should be set at any one time. always clear the pepgm bit before altering the addressing bits in the pebsr. otherwise, intermediate locations may be affected if the programming voltage is present.
personality eeprom (peeprom) peeprom programming mc68hc05k3 revision 4.0 technical data motorola personality eeprom (peeprom) 85 pebulk peeprom bulk erase bit the pebulk bit is a read/write bit to control the switches that apply an internally provided programming voltage to all the bits in the peeprom array that are to be erased. when the pebulk bit is set to a logical 1, a logical 0 is stored to all bits of the peeprom array regardless of the bit address specified in the pebsr. the pebulk bit should only be set if the pebyte and pepgm bits are cleared. if both the pebyte and pebulk bits are set, the personality eeprom is bulk erased. the pebulk bit is cleared when the device is reset. pedata peeprom data bit the pedata bit is a read-only bit that reflects the state of the peeprom sense amplifier. the state of the pedata bit is only meaningful when the pebyte, pepgm, pebulk, and cpen control bits are all 0. the state of the pedata bit following a reset is dependent on the stored data in bit 0 of the peeprom array. 9.4 peeprom programming the peeprom can be programmed using a motorola programmer or in the user application if the v dd supply source is at least 2.7 vdc . in the latter case, the programming software must be provided in the user rom and use some external pins in either a serial or parallel method for data transfer and/or access. each bit of the peeprom can be programmed using this step-by-step procedure: 1. write the desired bit location to be programmed into the pebsr located at $000e. 2. set the pepgm and cpen bits in the pescr located at $000f. 3. wait for a t epgm time delay. 4. clear the pepgm and cpen bits. the peeprom is then ready to be set up for another bit of data for programming.
technical data mc68hc05k3 revision 4.0 86 personality eeprom (peeprom) motorola personality eeprom (peeprom) the programming of a peeprom bit only requires access of that bit through the pebsr followed by setting the pepgm and cpen bits in the pescr. do not access any bits that are to be left unprogrammed (erased) until all the pepgm, pebyte, pebulk, and cpen bits in the pescr are cleared. always clear the pepgm, pebyte, pebulk, and cpen bits before altering the pebsr. 9.5 peeprom read access the contents of the peeprom are read in this sequence: 1. write the desired bit location to be read into the pebsr located at $000e. 2. read the state of the pedata bit in the pescr located at $000f. 3. store the state of the pedata bit into ram or a register. 4. select another bit by changing the pebsr. 5. continue reading and storing the pedata bit states until all the required peeprom data has been accessed. reading the peeprom is easiest when each row in the peeprom array is mapped to contain one byte of data. selecting a column zero bit selects the first bit in the row; and incrementing the peeprom bit select register (pebsr) selects the next (column 1) bit from the same row. incrementing the pebsr seven more times selects the remaining bits of the row and carries over to select column zero of the next row, thereby setting the column zero flag, pepczf in the pescr. the number of increments per row can be controlled by looping on a test of the pepczf flag bit. the complete array can be easily accessed by starting with $007f for the pebsr and decrementing the pebsr after each access of the pedata bit. the decrement sequence can end when the contents of the pebsr are 0. note: one byte of data from the peeprom can be re-created in the pebsr itself. this can be done if the read routine builds the 8-bit data byte in the index register or the accumulator and then transfers that result to the pebsr when completed. subsequent reads of the pebsr quickly yield that retrieved data byte.
personality eeprom (peeprom) peeprom serial programming mc68hc05k3 revision 4.0 technical data motorola personality eeprom (peeprom) 87 9.6 peeprom serial programming the mc68hc05k3 can be programmed, read, or bulk erased in a serial fashion using the reset, pb0 and irq pins in peeprom serial programming mode. ? the reset pin is used to begin and end sequences and must be able to toggle from 0 vdc to v dd . ? pb0 serves as the data pin and must be able to toggle from 0 vdc to v dd . ? irq is used as the clock/select line and must be able to toggle from 0 vdc to 2 x v dd . note: when not in serial programming mode, do not operate the device with more than v dd on the irq pin. 9.6.1 serial programming connections the required schematic considerations are shown in figure 9-4 . the serial programming connections can be shared with the application if certain considerations are met. 1. the application circuitry connected to the pb0 pin must allow this pin to be used as an input and not driven from some active source within the application other than the mc68hc05k3. this pin is driven to a logic high or low level by either an external source or by the mc68hc05k3 itself. 2. the application circuitry connected to the irq pin must be capable of being driven from an external source to a voltage, v selckh . 3. the application circuitry connected to the reset pin must allow this pin to be used as an input and not driven from some active source within the application other than the mc68hc05k3. 4. to use the on-chip charge pump for programming/erasure, the application circuitry must be capable of being supplied with a v dd source of at least 2.7 vdc. 5. the diagram in figure 9-4 shows the 3-pin rc oscillator connections. this circuit also works with the 2-pin crystal and rc oscillators and the pb1/osc3 pin can be left unconnected in those cases.
technical data mc68hc05k3 revision 4.0 88 personality eeprom (peeprom) motorola personality eeprom (peeprom) figure 9-4. serial programming connections 9.6.2 multiple devices in serial program mode if the preceding rules in 9.6.1 serial programming connections are met, multiple mc68hc05k3 devices can be connected in parallel during serial programming. all the parallel devices can share the same power supplies for the v dd and v ss ; and they may all share the same data and reset signals. the only signal that must be routed individually to each device is the sel/clk signal. programming time can be reduced by setting the data for each unit and then clocking its sel/clk low and remaining low until the data has been received by all other devices. then raise the sel/clk line high for all units after the required programming time. note: direct connection of the reset pin to the v dd supply should be avoided because as an internal reset source, such as a cop watchdog reset or an illegal address, reset turns on an internal pulldown device connected 16-pin pdip package reset 1 pb1/osc3 2 pb0 3 irq 4 pa0 5 pa1 6 pa2 7 pa3 8 osc1 16 osc2 15 vss 14 vdd 13 pa7 12 pa6 11 pa5 10 pa4 9 v dd v ss r c sel/clk reset data used in application as required input sources used in application used in application as required
personality eeprom (peeprom) peeprom serial programming mc68hc05k3 revision 4.0 technical data motorola personality eeprom (peeprom) 89 to the reset pin. this device may be capable of heavily loading the v dd supply source. 9.6.3 peeprom serial programming mode entry the sequence for entry into the personality eeprom serial programming mode to program, erase, or read data is: 1. connect all parallel device modules. 2. apply 0 vdc to the data, reset, and sel/clk signal lines. 3. apply a voltage v dds to the vdd suppy line. 4. apply v selckh to the sel/clk signal line. 5. wait for the initial startup delay (16 or 4064 internal ph2 processor clock cycles, depending on mask option). then raise the reset signal line to v dds . 6. do not raise the data signal line to v dds until after a time, t rdh . 7. during the select sequence, the sel/clk signal is toggled between 0 vdc and v selckh . the duration between transitions is specified by t clkhi and t clklo . the device is now monitoring the irq and pb0 pins to determine the type of procedure to execute. the state of the pb0 pin is examined following each high-to-low transition of the irq pin, as shown in figure 9-5 . the state of the pb0 pin during the second and third falling edges of sel/clk determines the type of operation. if the operation is to program or verify the contents of the personality eeprom, an additional 128 falling edges are required to store or retrieve data. the type of internal operation to be executed is defined in table 9-2 . the state of pb0 on the first falling edge of sel/clk is of no consequence; however, pb0 must remain low for a minimum of 10 internal clock cycles, t rdh , following negation of reset. the time delays required for various peeprom serial program mode operations are given in table 9-3 .
technical data mc68hc05k3 revision 4.0 90 personality eeprom (peeprom) motorola personality eeprom (peeprom) figure 9-5. peeprom serial programming mode data format sel/clk ( irq pin) data (pb0 pin ) v dd reset ( reset pin) test select (3 bits) peeprom data (128 bits) reset delayed 16 or 4064 ph2 clocks from power up of device 2 x v dd applied falling edge of irq is both select and clock delay at least t rdh before data pin is driven high table 9-2. peeprom serial programming mode operations first bit second bit third bit internal test operation x 0 0 serial program personality eeprom contents x 0 1 serial retrieval of personality eeprom contents x 1 0 unassigned x 1 1 bulk erasure of eeprom contents
personality eeprom (peeprom) serial programming sequence mc68hc05k3 revision 4.0 technical data motorola personality eeprom (peeprom) 91 9.7 serial programming sequence the programming of the internal personality eeprom always begins at bit address 00 of the 128-bit array. the signal timing on the irq and pb0 pins is shown in figure 9-6 , figure 9-7 , and figure 9-8 . the personality eeprom is serially programmed by using this sequence: 1. follow the serial programming mode entry routine as specified in 9.6.3 peeprom serial programming mode entry . 2. keep the data signal at 0 vdc throughout the select sequence. 3. clock the sel/clk signal line to 0 vdc and back to v selckh (first select bit). 4. clock the sel/clk signal line to 0 vdc and back to v selckh (second select bit). 5. clock the sel/clk signal line to 0 vdc and back to v selckh (third select bit). 6. the device is now ready to receive the data to be programmed into the 128 bits of the personality eeprom. during the next 128 clocks of the sel/clk signal line, the data to be stored into each bit (starting with location $00) must be present on the data signal line prior to the falling edge of the sel/clk signal line to 0 vdc. the time that the sel/clk signal line stays at 0 vdc is determined by the eeprom programming time (t epgm ). 7. on the 128th data bit, rather than drive the sel/clk signal high to complete the programming sequence, drive the reset pin to 0 v after a time, t epgm . this must be done to prevent the part from entering an unknown state. if all 128 bits do not need to be programmed, the reset pin may be driven to 0 v after the last bit has been programmed. this will complete the programming sequence. 8. while reset is held low, the pins can be conditioned for the next sequence. this completes the serial programming sequence. the device can now be verified by going to the serial data readout sequence or bulk erased by going to the bulk erase sequence.
technical data mc68hc05k3 revision 4.0 92 personality eeprom (peeprom) motorola personality eeprom (peeprom) figure 9-6. peeprom serial programming data in timing sel/clk ( irq) data (pb0) t rsu serial programming data in timing valid data in valid data in t clkhi t epgm t rhd sel/clk ( irq) data (pb0) end of programming sequence valid data in reset 128th bit t epgm t epgm
personality eeprom (peeprom) serial programming sequence mc68hc05k3 revision 4.0 technical data motorola personality eeprom (peeprom) 93 figure 9-7. peeprom serial read data out timing figure 9-8. bulk erase sequence sel/clk ( irq) data (pb0 ) serial read data out timing t drv t pbz valid data in valid data out sel/clk ( irq) data (pb0) end of read sequence valid data out reset 128th bit t clklo t clkhi t hiz sel/clk ( irq) data (pb0) reset t epgm t erbk
technical data mc68hc05k3 revision 4.0 94 personality eeprom (peeprom) motorola personality eeprom (peeprom) table 9-3. internal test time delays symbol description min max time v dds serial mode v dd voltage 2.7 5.5 v v selckh sel/clk high voltage 1.5 x v dd 2.0 x v dd v t rdh reset rising edge to 1st rising edge of data 10 f op cycles t clkhi sel/clk active high time 32 f op cycles t clklo sel/clk active low time (non-programming/erasing) 32 see note f op cycles t rsu read data in setup before falling edge of sel/clk 0 f op cycles t rhd read data in hold after falling edge of sel/clk 16 f op cycles t epgm programming time for eeprom cell 10 15 ms t rclk reset rising edge to falling edge of sel/clk 5 f op cycles t drv data output drive after rising edge of sel/clk 4 8 f op cycles t hiz data output hi-z after rising edge of sel/clk 8 f op cycles t pbz data hi-z before rising edge of sel/clk 0 f op cycles t erbk bulk erase time for eeprom array 30 30 ms note: if computer operating properly (cop) watchdog timer is enabled through mask option, the maximum allowable interval between any two successive high-to-low transitions of sel/clk is 7 x 2 17 f op cycles.
personality eeprom (peeprom) serial data readout sequence mc68hc05k3 revision 4.0 technical data motorola personality eeprom (peeprom) 95 9.8 serial data readout sequence the read sequence of the internal personality eeprom always begins at bit address 00 of the 128-bit array. the signal timing on the irq and pb0 pins is shown in figure 9-7 . the personality eeprom can be serially read out by using this sequence: 1. follow the serial programming mode entry routine as specified in 9.6.3 peeprom serial programming mode entry . 2. keep the data signal at 0 vdc. 3. clock the sel/clk signal line to 0 vdc and back to v selckh (first select bit). 4. clock the sel/clk signal line to 0 vdc and back to v selckh (second select bit). 5. raise the data signal line to v dds . 6. clock the sel/clk signal line to 0 vdc and back to v selckh (third select bit). 7. the device is now ready to transmit the data that has been programmed or erased into the 128 bits of the personality eeprom. during the next 128 clocks of the sel/clk signal line, the stored data for each bit (starting with location $00) is presented on the data signal line prior to the falling edge of the sel/clk signal line to 0 vdc. the data is valid within t drv internal cycles after the rising edge of sel/clk and is valid when the sel/clk signal line falls for a time, t hiz . 8. on the 128th data bit, rather than drive the sel/clk signal low to complete the read sequence, drive the reset pin to 0 v. this must be done to prevent the part from entering an unknown state. if all 128 bits do not need to be verified, the reset pin may be driven to 0 v after the last bit has been verified. 9. while reset is held low, the pins can be conditioned for the next sequence. this completes the serial data readout sequence, and the device can now be completely erased by going to the bulk erase sequence if the verification sequence fails to read the desired data.
technical data mc68hc05k3 revision 4.0 96 personality eeprom (peeprom) motorola personality eeprom (peeprom) 9.9 serial bulk erase sequence the signal timing on the irq and pb0 pins is shown in figure 9-8 . the personality eeprom can be bulk erased by using this sequence: 1. follow the serial programming mode entry routine as specified in 9.6.3 peeprom serial programming mode entry . 2. keep the data signal at 0 vdc. 3. clock the sel/clk signal line to 0 vdc and back to v selckh (first select bit). 4. raise the data signal to v dds . 5. clock the sel/clk signal line to 0 vdc and back to v selckh (second select bit). 6. clock the sel/clk signal line to 0 vdc. do not bring the sel/clk signal line back to v selckh as in other select sequences (third select bit). this starts the bulk erase sequence. 7. after a time, t erbk , drive the reset pin to 0 v to complete the bulk erase sequence. this must be done to prevent the part from entering an unkown state. 8. while reset is held low, the pins can be conditioned for the next sequence. this completes the bulk erase sequence. the device can now be programmed by going to the serial programming sequence or verified by going to the serial verification sequence.
mc68hc05k3 revision 4.0 technical data motorola instruction set 97 technical data mc68hc05k3 section 10. instruction set 10.1 contents 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 10.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 10.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.3.2 immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 10.3.6 indexed, 8-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 10.3.7 indexed,16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 10.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 10.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 10.4.1 register/memory instructions. . . . . . . . . . . . . . . . . . . . . . .102 10.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .103 10.4.3 jump/branch instructions. . . . . . . . . . . . . . . . . . . . . . . . . .104 10.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .106 10.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 10.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
technical data mc68hc05k3 revision 4.0 98 instruction set motorola instruction set 10.2 introduction the mcu instruction set has 62 instructions and uses eight addressing modes. the instructions include all those of the m146805 cmos family plus one more: the unsigned multiply (mul) instruction. the mul instruction allows unsigned multiplication of the contents of the accumulator (a) and the index register (x). the high-order product is stored in the index register, and the low-order product is stored in the accumulator. 10.3 addressing modes the cpu uses eight addressing modes for flexibility in accessing data. the addressing modes provide eight different ways for the cpu to find the data required to execute an instruction. the eight addressing modes are: ? inherent ? immediate ? direct ? extended ? indexed, no offset ? indexed, 8-bit offset ? indexed, 16-bit offset ? relative
instruction set addressing modes mc68hc05k3 revision 4.0 technical data motorola instruction set 99 10.3.1 inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in the cpu registers, such as set carry flag (sec) and increment accumulator (inca). inherent instructions require no operand address and are one byte long. 10.3.2 immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instructions require no operand address and are two bytes long. the opcode is the first byte, and the immediate data value is the second byte. 10.3.3 direct direct instructions can access any of the first 256 memory locations with two bytes. the first byte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address. 10.3.4 extended extended instructions use three bytes and can access any address in memory. the first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction.
technical data mc68hc05k3 revision 4.0 100 instruction set motorola instruction set 10.3.5 indexed, no offset indexed instructions with no offset are 1-byte instructions that can access data with variable addresses within the first 256 memory locations. the index register contains the low byte of the effective address of the operand. the cpu automatically uses $00 as the high byte, so these instructions can address locations $0000C$00ff. indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used ram or i/o location. 10.3.6 indexed, 8-bit offset indexed, 8-bit offset instructions are 2-byte instructions that can access data with variable addresses within the first 511 memory locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the effective address of the operand. these instructions can access locations $0000C$01fe. indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the first 256 memory locations and could extend as far as location 510 ($01fe). the k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode. 10.3.7 indexed,16-bit offset indexed, 16-bit offset instructions are 3-byte instructions that can access data with variable addresses at any location in memory. the cpu adds the unsigned byte in the index register to the two unsigned bytes following the opcode. the sum is the effective address of the operand. the first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. as with direct and extended addressing, the motorola assembler determines the shortest form of indexed addressing.
instruction set instruction types mc68hc05k3 revision 4.0 technical data motorola instruction set 101 10.3.8 relative relative addressing is only for branch instructions. if the branch condition is true, the cpu finds the effective branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, twos complement byte that gives a branching range of C128 to +127 bytes from the address of the next location after the branch instruction. when using the motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch. 10.4 instruction types the mcu instructions fall into the following five categories: ? register/memory instructions ? read-modify-write instructions ? jump/branch instructions ? bit manipulation instructions ? control instructions
technical data mc68hc05k3 revision 4.0 102 instruction set motorola instruction set 10.4.1 register/memory instructions these instructions operate on cpu registers and memory locations. most of them use two operands. one operand is in either the accumulator or the index register. the cpu finds the other operand in memory. table 10-1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub
instruction set instruction types mc68hc05k3 revision 4.0 technical data motorola instruction set 103 10.4.2 read-modify-write instructions these instructions read a memory location or a register, modify its contents, and write the modified value back to the memory location or to the register. note: do not use read-modify-write operations on write-only registers. table 10-2. read-modify-write instructions instruction mnemonic arithmetic shift left (same as lsl) asl arithmetic shift right asr bit clear bclr (1) 1. unlike other read-modify-write instructions, bclr and bset use only direct addressing. bit set bset (1) clear register clr complement (ones complement) com decrement dec increment inc logical shift left (same as asl) lsl logical shift right lsr negate (twos complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst (2) 2. tst is an exception to the read-modify-write sequence because it does not write a replacement value. notes:
technical data mc68hc05k3 revision 4.0 104 instruction set motorola instruction set 10.4.3 jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump-to-subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. the brclr and brset instructions cause a branch based on the state of any readable bit in the first 256 memory locations. these 3-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be tested is in the byte following the opcode. the third byte is the signed offset byte. the cpu finds the effective branch destination by adding the third byte to the program counter if the specified bit tests true. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from C128 to +127 from the address of the next location after the branch instruction. the cpu also transfers the tested bit to the carry/borrow bit of the condition code register.
instruction set instruction types mc68hc05k3 revision 4.0 technical data motorola instruction set 105 table 10-3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr
technical data mc68hc05k3 revision 4.0 106 instruction set motorola instruction set 10.4.4 bit manipulation instructions the cpu can set or clear any writable bit in the first 256 bytes of memory, which includes i/o registers and on-chip ram locations. the cpu can also test and branch based on the state of any bit in any of the first 256 memory locations. table 10-4. bit manipulation instructions instruction mnemonic bit clear bclr branch if bit clear brclr branch if bit set brset bit set bset
instruction set instruction types mc68hc05k3 revision 4.0 technical data motorola instruction set 107 10.4.5 control instructions these instructions act on cpu registers and control cpu operation during program execution. table 10-5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait
technical data mc68hc05k3 revision 4.0 108 instruction set motorola instruction set 10.5 instruction set summary table 10-6. instruction set summary (sheet 1 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a ? (a) + (m) + (c) imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a ? (a) + (m) imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a ? (a) (m) imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bclr n opr clear bit n mn ? 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 beq rel branch if equal pc ? (pc) + 2 + rel ? z = 1 rel 27 rr 3 bhcc rel branch if half-carry bit clear pc ? (pc) + 2 + rel ? h = 0 rel 28 rr 3 bhcs rel branch if half-carry bit set pc ? (pc) + 2 + rel ? h = 1 rel 29 rr 3 bhi rel branch if higher pc ? (pc) + 2 + rel ? c z = 0 rel 22 rr 3 bhs rel branch if higher or same pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 c b0 b7 0 b0 b7 c
instruction set instruction set summary mc68hc05k3 revision 4.0 technical data motorola instruction set 109 bih rel branch if irq pin high pc ? (pc) + 2 + rel ? irq = 1 rel 2f rr 3 bil rel branch if irq pin low pc ? (pc) + 2 + rel ? irq = 0 rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 bls rel branch if lower or same pc ? (pc) + 2 + rel ? c z = 1 rel 23 rr 3 bmc rel branch if interrupt mask clear pc ? (pc) + 2 + rel ? i = 0 rel 2c rr 3 bmi rel branch if minus pc ? (pc) + 2 + rel ? n = 1 rel 2b rr 3 bms rel branch if interrupt mask set pc ? (pc) + 2 + rel ? i = 1 rel 2d rr 3 bne rel branch if not equal pc ? (pc) + 2 + rel ? z = 0 rel 26 rr 3 bpl rel branch if plus pc ? (pc) + 2 + rel ? n = 0 rel 2a rr 3 bra rel branch always pc ? (pc) + 2 + rel ? 1 = 1 rel 20 rr 3 brclr n opr rel branch if bit n clear pc ? (pc) + 2 + rel ? mn = 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc ? (pc) + 2 + rel ? 1 = 0 rel 21 rr 3 brset n opr rel branch if bit n set pc ? (pc) + 2 + rel ? mn = 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 bset n opr set bit n mn ? 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc ? (pc) + 2; push (pcl) sp ? (sp) C 1; push (pch) sp ? (sp) C 1 pc ? (pc) + rel rel ad rr 6 clc clear carry bit c ? 0 0 inh 98 2 cli clear interrupt mask i ? 0 0 inh 9a 2 table 10-6. instruction set summary (sheet 2 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
technical data mc68hc05k3 revision 4.0 110 instruction set motorola instruction set clr opr clra clrx clr opr ,x clr ,x clear byte m ? $00 a ? $00 x ? $00 m ? $00 m ? $00 0 1 dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) C (m) imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (ones complement) m ? ( m ) = $ff C (m) a ? ( a ) = $ff C (a) x ? ( x ) = $ff C (x) m ? ( m ) = $ff C (m) m ? ( m ) = $ff C (m) 1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) C (m) imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m ? (m) C 1 a ? (a) C 1 x ? (x) C 1 m ? (m) C 1 m ? (m) C 1 dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a ? (a) ? (m) imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 inc opr inca incx inc opr ,x inc ,x increment byte m ? (m) + 1 a ? (a) + 1 x ? (x) + 1 m ? (m) + 1 m ? (m) + 1 dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc ? jump address dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 table 10-6. instruction set summary (sheet 3 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
instruction set instruction set summary mc68hc05k3 revision 4.0 technical data motorola instruction set 111 jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc ? (pc) + n (n = 1, 2, or 3) push (pcl); sp ? (sp) C 1 push (pch); sp ? (sp) C 1 pc ? effective address dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a ? (m) imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x ? (m) imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right 0 dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a ? (x) (a) 0 0 inh 42 11 neg opr nega negx neg opr ,x neg ,x negate byte (twos complement) m ? C(m) = $00 C (m) a ? C(a) = $00 C (a) x ? C(x) = $00 C (x) m ? C(m) = $00 C (m) m ? C(m) = $00 C (m) dir inh inh ix1 ix 30 40 50 60 70 dd ff 5 3 3 6 5 nop no operation inh 9d 2 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a ? (a) (m) imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 table 10-6. instruction set summary (sheet 4 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc c b0 b7 0 b0 b7 c 0 c b0 b7
technical data mc68hc05k3 revision 4.0 112 instruction set motorola instruction set ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp ? $00ff inh 9c 2 rti return from interrupt sp ? (sp) + 1; pull (ccr) sp ? (sp) + 1; pull (a) sp ? (sp) + 1; pull (x) sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 80 9 rts return from subroutine sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 81 6 sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a ? (a) C (m) C (c) imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c ? 1 1 inh 99 2 sei set interrupt mask i ? 1 1 inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m ? (a) dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin 0 inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m ? (x) dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a ? (a) C (m) imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc ? (pc) + 1; push (pcl) sp ? (sp) C 1; push (pch) sp ? (sp) C 1; push (x) sp ? (sp) C 1; push (a) sp ? (sp) C 1; push (ccr) sp ? (sp) C 1; i ? 1 pch ? interrupt vector high byte pcl ? interrupt vector low byte 1 inh 83 10 tax transfer accumulator to index register x ? (a) inh 97 2 table 10-6. instruction set summary (sheet 5 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc b0 b7 c
instruction set instruction set summary mc68hc05k3 revision 4.0 technical data motorola instruction set 113 tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) C $00 dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 txa transfer index register to accumulator a ? (x) inh 9f 2 wait stop cpu clock and enable interrupts 0 inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow ?ag pc program counter ccr condition code register pch program counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing rr relative program counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry ?ag z zero ?ag hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode ? logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode C( ) negation (twos complement) ix1 indexed, 8-bit offset addressing mode ? loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative ?ag set or cleared n any bit not affected table 10-6. instruction set summary (sheet 6 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
technical data mc68hc05k3 revision 4.0 114 instruction set motorola instruction set table 10-7. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789 abcdef 0 5 brset0 3 dir 5 bset0 2 dir 3 bra 2 rel 5 neg 2 dir 3 nega 1 inh 3 negx 1 inh 6 neg 2 ix1 5 neg 1ix 9 rti 1 inh 2 sub 2 imm 3 sub 2 dir 4 sub 3 ext 5 sub 3 ix2 4 sub 2 ix1 3 sub 1ix 0 1 5 brclr0 3 dir 5 bclr0 2 dir 3 brn 2 rel 6 rts 1 inh 2 cmp 2 imm 3 cmp 2 dir 4 cmp 3 ext 5 cmp 3 ix2 4 cmp 2 ix1 3 cmp 1ix 1 2 5 brset1 3 dir 5 bset1 2 dir 3 bhi 2 rel 11 mul 1 inh 2 sbc 2 imm 3 sbc 2 dir 4 sbc 3 ext 5 sbc 3 ix2 4 sbc 2 ix1 3 sbc 1ix 2 3 5 brclr1 3 dir 5 bclr1 2 dir 3 bls 2 rel 5 com 2 dir 3 coma 1 inh 3 comx 1 inh 6 com 2 ix1 5 com 1ix 10 swi 1 inh 2 cpx 2 imm 3 cpx 2 dir 4 cpx 3 ext 5 cpx 3 ix2 4 cpx 2 ix1 3 cpx 1ix 3 4 5 brset2 3 dir 5 bset2 2 dir 3 bcc 2 rel 5 lsr 2 dir 3 lsra 1 inh 3 lsrx 1 inh 6 lsr 2 ix1 5 lsr 1ix 2 and 2 imm 3 and 2 dir 4 and 3 ext 5 and 3 ix2 4 and 2 ix1 3 and 1ix 4 5 5 brclr2 3 dir 5 bclr2 2 dir 3 bcs/blo 2 rel 2 bit 2 imm 3 bit 2 dir 4 bit 3 ext 5 bit 3 ix2 4 bit 2 ix1 3 bit 1ix 5 6 5 brset3 3 dir 5 bset3 2 dir 3 bne 2 rel 5 ror 2 dir 3 rora 1 inh 3 rorx 1 inh 6 ror 2 ix1 5 ror 1ix 2 lda 2 imm 3 lda 2 dir 4 lda 3 ext 5 lda 3 ix2 4 lda 2 ix1 3 lda 1ix 6 7 5 brclr3 3 dir 5 bclr3 2 dir 3 beq 2 rel 5 asr 2 dir 3 asra 1 inh 3 asrx 1 inh 6 asr 2 ix1 5 asr 1ix 2 ta x 1 inh 4 sta 2 dir 5 sta 3 ext 6 sta 3 ix2 5 sta 2 ix1 4 sta 1ix 7 8 5 brset4 3 dir 5 bset4 2 dir 3 bhcc 2 rel 5 asl/lsl 2 dir 3 asla/lsla 1 inh 3 aslx/lslx 1 inh 6 asl/lsl 2 ix1 5 asl/lsl 1ix 2 clc 1 inh 2 eor 2 imm 3 eor 2 dir 4 eor 3 ext 5 eor 3 ix2 4 eor 2 ix1 3 eor 1ix 8 9 5 brclr4 3 dir 5 bclr4 2 dir 3 bhcs 2 rel 5 rol 2 dir 3 rola 1 inh 3 rolx 1 inh 6 rol 2 ix1 5 rol 1ix 2 sec 1 inh 2 adc 2 imm 3 adc 2 dir 4 adc 3 ext 5 adc 3 ix2 4 adc 2 ix1 3 adc 1ix 9 a 5 brset5 3 dir 5 bset5 2 dir 3 bpl 2 rel 5 dec 2 dir 3 deca 1 inh 3 decx 1 inh 6 dec 2 ix1 5 dec 1ix 2 cli 1 inh 2 ora 2 imm 3 ora 2 dir 4 ora 3 ext 5 ora 3 ix2 4 ora 2 ix1 3 ora 1ix a b 5 brclr5 3 dir 5 bclr5 2 dir 3 bmi 2 rel 2 sei 1 inh 2 add 2 imm 3 add 2 dir 4 add 3 ext 5 add 3 ix2 4 add 2 ix1 3 add 1ix b c 5 brset6 3 dir 5 bset6 2 dir 3 bmc 2 rel 5 inc 2 dir 3 inca 1 inh 3 incx 1 inh 6 inc 2 ix1 5 inc 1ix 2 rsp 1 inh 2 jmp 2 dir 3 jmp 3 ext 4 jmp 3 ix2 3 jmp 2 ix1 2 jmp 1ix c d 5 brclr6 3 dir 5 bclr6 2 dir 3 bms 2 rel 4 tst 2 dir 3 tsta 1 inh 3 tstx 1 inh 5 tst 2 ix1 4 tst 1ix 2 nop 1 inh 6 bsr 2 rel 5 jsr 2 dir 6 jsr 3 ext 7 jsr 3 ix2 6 jsr 2 ix1 5 jsr 1ix d e 5 brset7 3 dir 5 bset7 2 dir 3 bil 2 rel 2 stop 1 inh 2 ldx 2 imm 3 ldx 2 dir 4 ldx 3 ext 5 ldx 3 ix2 4 ldx 2 ix1 3 ldx 1ix e f 5 brclr7 3 dir 5 bclr7 2 dir 3 bih 2 rel 5 clr 2 dir 3 clra 1 inh 3 clrx 1 inh 6 clr 2 ix1 5 clr 1ix 2 wait 1 inh 2 txa 1 inh 4 stx 2 dir 5 stx 3 ext 6 stx 3 ix2 5 stx 2 ix1 4 stx 1ix f inh = inherentrel = relative imm = immediateix = indexed, no offset dir = directix1 = indexed, 8-bit offset ext = extendedix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3 dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb msb lsb msb
mc68hc05k3 revision 4.0 technical data motorola electrical specifications 115 technical data mc68hc05k3 section 11. electrical specifications 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 11.3 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 11.4 operating range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 11.5 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 11.6 5.0-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .118 11.7 3.0-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .119 11.8 5.0-volt control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120 11.9 3.0-volt control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 11.10 1.8-volt control timing (peeprom read only) . . . . . . . . . .122 11.2 introduction this section contains electrical and timing specifications.
technical data mc68hc05k3 revision 4.0 116 electrical specifications motorola electrical speci?cations 11.3 maximum ratings maximum ratings are the extreme limits to which the mcu can be exposed without permanently damaging it. the mcu contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in the table below. keep v in and v out within the range v ss (v in or v out ) v dd . connect unused inputs to the appropriate voltage level, either v ss or v dd note: this device is not guaranteed to operate properly at the maximum ratings. refer to 11.6 5.0-volt dc electrical characteristics and 11.7 3.0-volt dc electrical characteristics for guaranteed operating conditions. rating symbol value unit supply voltage v dd C0.3 to + 7.0 v input voltage v in v ss C0.3 to v dd + C0.3 v input voltage ( irq pin only) v in 2 x v dd v current drain per pin excluding v dd and v ss i25ma storage temperature range t stg C65 to + 150 c
electrical specifications operating range mc68hc05k3 revision 4.0 technical data motorola electrical specifications 117 11.4 operating range 11.5 thermal characteristics characteristic symbol value unit operating temperature range mc68hc05k3 (standard) mc68hc05k3 (extended) t a t l to t h 0 to +70 C40 to +85 c supply voltage range for internal charge pump operation v ddcp 2.7 to 5.5 v characteristic symbol value unit thermal resistance pdip soic q ja 100 140 c/w
technical data mc68hc05k3 revision 4.0 118 electrical specifications motorola electrical speci?cations 11.6 5.0-volt dc electrical characteristics characteristic (1) 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = C40 c to +85 c, unless otherwise noted. symbol min (2) 2. all values shown reflect average measurements. typ (3) 3. typical values at midpoint of voltage range, 25 c only max unit output high voltage (i load = C0.8 ma) pa7Cpa0, pb1/osc3, pb0 v oh v dd C0.8 v output low voltage pa3Cpa0, pb1/osc3, pb0 (i load = 1.6 ma) pa7Cpa4 (i load = 8.0 ma) v ol 0.4 0.4 v input high voltage pa0Cpa7, pb0, pb1/osc3, irq, reset, osc1 v ih 0.7 x v dd v dd v input low voltage pa0Cpa7, pb0, pb1/osc3, irq, reset, osc1 v il v ss 0.2 x v dd v supply current (f op = 2 mhz) (4), (5), (6), (7), (8) run wait stop 25 c 0 c to +70 c (standard) C40 c to +85 c (extended) 4. wait i dd : only timer system active 5. run (operating) i dd , wait i dd : measured using external square wave clock source to osc1, all inputs 0.2 vdc from rail; no dc loads, less than 50 pf on all outputs, c l = 20 pf on osc2. 6. wait, stop i dd : all ports configured as inputs, v il = 0.2 vdc, v ih = v dd C0.2 vdc 7. stop i dd measured with osc1 = v dd , reset open 8. wait i dd is affected linearly by the osc2 capacitance. i dd 100 5.0 3.0 200 400 500 ma ma na na na i/o ports hi-z leakage current pa0Cpa7, pb0Cpb1 (without pulldowns activated) i il 0.2 1 m a input pulldown current pa0Cpa7, pb0Cpb1 i il 50 100 200 m a input current irq and osc1 reset (v in = v ih ) reset (v in = v il ) i in 15 50 1 m a reset, internal pulldown device i in 1.0 4.0 8.0 ma capacitance ports (as input or output) reset, irq, osc1, osc2 c out c in 12 8 pf crystal/ceramic resonator oscillator mode internal resistor osc1 to osc2 r osc 1.0 2.0 3.0 m w notes:
electrical specifications 3.0-volt dc electrical characteristics mc68hc05k3 revision 4.0 technical data motorola electrical specifications 119 11.7 3.0-volt dc electrical characteristics characteristic (1) 1. v dd = 3.0 vdc 10%, v ss = 0 vdc, t a = C40 c to +85 c, unless otherwise noted symbol min (2) 2. all values shown re?ect average measurements typ (3) 3. typical values at midpoint of voltage range, 25 c only max unit output high voltage (i load = C0.4 ma) pa7Cpa0, pb1/osc3, pb0 v oh v dd C0.3 v output low voltage pa3Cpa0, pb1/osc3, pb0 (i load = 0.4 ma) pa7Cpa4 (i load = 4.0 ma) v ol 0.3 0.3 v input high voltage pa0Cpa7, pb0, pb1/osc3, irq, reset, osc1 v ih 0.7 x v dd v dd v input low voltage pa0Cpa7, pb0, pb1/osc3, irq, reset, osc1 v il v ss 0.2 x v dd v supply current (f op = 1 mhz) (4), (5), (6), (7), (8) run wait stop 25 c 0 c to +70 c (standard) C40 c to +85 c (extended) 4. wait i dd : only timer system active 5. run (operating) i dd , wait i dd : measured using external square wave clock source to osc1, all inputs 0.2 vdc from rail; no dc loads, less than 50 pf on all outputs, c l = 20 pf on osc2 6. wait, stop i dd : all ports con?gured as inputs, v il = 0.2 vdc, v ih =v dd C0.2 vdc 7. stop i dd measured with osc1 = v dd , reset open 8. wait i dd is affected linearly by the osc2 capacitance i dd 50 2.0 0.75 100 175 200 ma ma na na na i/o ports hi-z leakage current pa0Cpa7, pb0Cpb1 (without individual pulldown activated) i il 0.1 1 m a input pulldown current pa0Cpa7, pb0Cpb1 i il 25 50 100 m a input current irq, osc1 reset (v in = v ih ) reset (v in = v il ) i in 10 30 1 m a reset, internal pulldown device i in 0.2 2.0 4.0 ma capacitance ports (as input or output) reset, irq, osc1, osc2 c out c in 12 8 pf crystal/ceramic resonator oscillator mode internal resistor osc1 to osc2 r osc 1.0 2.0 3.0 m w notes:
technical data mc68hc05k3 revision 4.0 120 electrical specifications motorola electrical speci?cations 11.8 5.0-volt control timing characteristic (1) 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = C40 c to +85 c, unless otherwise noted symbol min max unit frequency of operation 3-pin rc oscillator option 2-pin rc oscillator option crystal oscillator option external clock source f osc 0.1 0.1 0.5 dc 1.25 2.7 4.0 4.0 mhz internal operating frequency rc oscillator (f osc ? 2) crystal oscillator (f osc ? 2) external clock (f osc ? 2) f op 0.5 1.0 dc 1.0 2.0 2.0 mhz cycle time (1 ? f op )t cyc 500 n s rc oscillator stabilization time t rcon 1ms crystal oscillator startup time (crystal oscillator option) t oxon 100 ms stop recovery startup time (crystal oscillator option) t ilch 100 ms reset pulse width low t rl 1.5 t cyc timer resolution (2) 2. the 2-bit timer prescaler is the limiting factor in determining timer resolution. t resl 4.0 t cyc irq interrupt pulse width low (edge-triggered) t ilih 125 ns irq interrupt pulse period t ilil (3) 3. the minimum period, t ilil or t ihih , should not be less than the number of cycles it takes to execute the interrupt service routine plus 19 t cyc . t cyc pa0Cpa3 interrupt pulse width high (edge-triggered) t ihil 125 ns pa0Cpa3 interrupt pulse period t ihih (3) t cyc osc1 pulse width t 90 ns 2-pin rc oscillator frequency combined stability (4) f osc = 500 khz 4. effects of processing, temperature, and supply voltage (including tolerances of external 1% r and 2% c) d f osc 35 % 3-pin rc oscillator frequency combined stability (4) f osc = 500 khz d f osc 25 % peeprom bit programming time t epgm 10ms peeprom byte erase time t erbt 10ms peeprom bulk erase time t erbk 30ms peeprom charge pump startup time t cp 1ms notes:
electrical specifications 3.0-volt control timing mc68hc05k3 revision 4.0 technical data motorola electrical specifications 121 11.9 3.0-volt control timing characteristic (1) 1. v dd = 3.0 vdc 10%, v ss = 0 vdc, t a = C40 c to +85 c, unless otherwise noted symbol min max unit frequency of operation 3-pin rc oscillator option 2-pin rc oscillator option crystal oscillator option external clock source f osc 0.1 0.1 0.4 dc 0.6 0.7 2.0 2.0 mhz internal operating frequency rc oscillator (f osc ? 2) crystal oscillator (f osc ? 2) external clock (f osc ? 2) f op dc 0.35 1.0 1.0 mhz cycle time (1 ? f op )t cyc 1.0 m s rc oscillator stabilization time t rcon 1ms crystal oscillator startup time (crystal oscillator option) t oxon 100 ms stop recovery startup time (crystal oscillator option) t ilch 100 ms reset pulse width low t rl 1.5 t cyc timer resolution (2) 2. the 2-bit timer prescaler is the limiting factor in determining timer resolution. t resl 4.0 t cyc irq interrupt pulse width low (edge-triggered) t ilih 125 ns irq interrupt pulse period t ilil (3) 3. the minimum period, t ilil or t ihih , should not be less than the number of cycles it takes to execute the interrupt service routine plus 19 t cyc . t cyc pa0Cpa3 interrupt pulse width high (edge-triggered) t ihil 125 ns pa0Cpa3 interrupt pulse period t ihih (3) t cyc osc1 pulse width t 180 ns 2-pin rc oscillator frequency combined stability (4) f osc = 500 khz 4. effects of processing, temperature, and supply voltage (including tolerances of external 1% r and 2% c) d f osc 35 % 3-pin rc oscillator frequency combined stability (4) f osc = 500 khz d f osc 15 % peeprom bit programming time t epgm 15ms peeprom byte erase time t erbt 15ms peeprom bulk erase time t erbk 30ms peeprom charge pump startup time t cp 1ms notes:
technical data mc68hc05k3 revision 4.0 122 electrical specifications motorola electrical speci?cations 11.10 1.8-volt control timing (peeprom read only) characteristic (1) 1. v dd = 1.8 vdc minimum, v ss = 0 vdc, t a = C40 c to +85 c, unless otherwise noted symbol min max unit frequency of operation 3-pin rc oscillator option 2-pin rc oscillator option crystal oscillator option external clock source f osc 0.1 0.1 0.4 dc 0.6 0.7 1.0 1.0 mhz internal operating frequency rc oscillator (f osc ? 2) crystal oscillator (f osc ? 2) external clock (f osc ? 2) f op dc 350 500 500 khz cycle time (1 ? f op )t cyc 2.0 m s rc oscillator stabilization time t rcon 1ms crystal oscillator startup time (crystal oscillator option) t oxon 100 ms stop recovery startup time (crystal oscillator option) t ilch 100 ms reset pulse width low t rl 1.5 t cyc timer resolution (2) 2. the 2-bit timer prescaler is the limiting factor in determining timer resolution. t resl 4.0 t cyc irq interrupt pulse width low (edge-triggered) t ilih 125 ns irq interrupt pulse period t ilil (3) 3. the minimum period, t ilil or t ihih , should not be less than the number of cycles it takes to execute the interrupt service routine plus 19 t cyc . t cyc pa0Cpa3 interrupt pulse width high (edge-triggered) t ihil 125 ns pa0Cpa3 interrupt pulse period t ihih (3) t cyc osc1 pulse width t 360 ns 2-pin rc oscillator frequency combined stability (4) f osc = 500 khz 4. effects of processing, temperature, and supply voltage (including tolerances of external 1% r and 2% c) d f osc 35 % 3-pin rc oscillator frequency combined stability (4) f osc = 500 khz d f osc 15 % notes:
mc68hc05k3 revision 4.0 technical data motorola mechanical specifications 123 technical data mc68hc05k3 section 12. mechanical specifications 12.1 contents 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 12.3 dual in-line package (case 648). . . . . . . . . . . . . . . . . . . . . .124 12.4 small outline integrated circuit (case 751) . . . . . . . . . . . . . .124 12.5 super small outline package (case 940c) . . . . . . . . . . . . . .125 12.2 introduction the mc68hc05k3 is available in these packages: ? plastic dual in-line package (pdip) ? small outline integrated circuit (soic) ? super small outline package (ssop) the following figures show the latest packages at the time of this publication. to make sure that you have the latest package specifications, contact one of the following: ? local motorola sales office ? motorola mfax C phone 602-244-6609 C email rmfax0@email.sps.mot.com ? worldwide web (wwweb) at http://design-net.com follow mfax or wwweb on-line instructions to retrieve the current mechanical specifications.
technical data mc68hc05k3 revision 4.0 124 mechanical specifications motorola mechanical speci?cations 12.3 dual in-line package (case 648) 12.4 small outline integrated circuit (case 751) -a- b f c s h g d 16 pl j l m seating plane 18 9 16 k -t- m a m 0.25 (0.010) t dim min max min max millimeters inches a 0.740 0.770 18.80 19.55 b 0.250 0.270 6.35 6.85 c 0.145 0.175 3.69 4.44 d 0.015 0.021 0.39 0.53 f 0.040 0.70 1.02 1.77 g 0.100 bsc 2.54 bsc h 0.050 bsc 1.27 bsc j 0.008 0.015 0.21 0.38 k 0.110 0.130 2.80 3.30 l 0.295 0.305 7.50 7.74 m 0 10 0 10 s 0.020 0.040 0.51 1.01 f j dim min max min max inches millimeters a 10.15 10.45 0.400 0.411 b 7.40 7.60 0.292 0.299 c 2.35 2.65 0.093 0.104 d 0.35 0.49 0.014 0.019 f 0.50 0.90 0.020 0.035 g 1.27 bsc 0.050 bsc j 0.25 0.32 0.010 0.012 k 0.10 0.25 0.004 0.009 m 0 7 0 7 p 10.05 10.55 0.395 0.415 r 0.25 0.75 0.010 0.029 m b m 0.010 (0.25) -a- -b- p 8x g 14x d 16x seating plane -t- s a m 0.010 (0.25) b s t 16 9 8 1 r x 45 m c k
mechanical specifications super small outline package (case 940c) mc68hc05k3 revision 4.0 technical data motorola mechanical specifications 125 12.5 super small outline package (case 940c) 20 11 10 1 h a b f m k 20x ref s u m 0.12 (0.005) v s t l l/2 pin 1 ident s u m 0.20 (0.008) t v u d c 0.076 (0.003) g t seating plane detail e n n 0.25 (0.010) ???? ???? k j j1 k1 section nn dim a min max min max inches 7.07 7.33 0.278 0.288 millimeters b 5.20 5.38 0.205 0.212 c 1.73 1.99 0.068 0.078 d 0.05 0.21 0.002 0.008 f 0.63 0.95 0.024 0.037 g 0.65 bsc 0.026 bsc h 0.59 0.75 0.023 0.030 j 0.09 0.20 0.003 0.008 j1 0.09 0.16 0.003 0.006 k 0.25 0.38 0.010 0.015 k1 0.25 0.33 0.010 0.013  notes: 1. dimensioning and tolerancing per ansi y14.5m, 1982. 2. controlling dimension: millimeter. 3. dimension a does not include mold flash, protrusions or gate burrs. mold flash or gate burrs shall not exceed 0.15 (0.006) per side. 4. dimension b does not include interlead flash or protrusion. interlead flash or protrusion shall not exceed 0.15 (0.006) per side. 5. dimension k does not include dambar protrusion/intrusion. allowable dambar protrusion shall be 0.13 (0.005) total in excess of k dimension at maximum material condition. dambar intrusion shall not reduce dimension k by more than 0.07 (0.002) at least material condition. 6. terminal numbers are shown for reference only. 7. dimension a and b are to be determined at datum plane w. l 7.65 7.90 0.301 0.311 m 0 8 0 8 detail e w
technical data mc68hc05k3 revision 4.0 126 mechanical specifications motorola mechanical speci?cations
mc68hc05k3 revision 4.0 technical data motorola ordering information 127 technical data mc68hc05k3 section 13. ordering information 13.1 contents 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 13.3 mcu ordering forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 13.4 application program media. . . . . . . . . . . . . . . . . . . . . . . . . . .128 13.5 rom program verification . . . . . . . . . . . . . . . . . . . . . . . . . . .129 13.6 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 13.2 introduction this section contains instructions for ordering custom-masked rom mcus. 13.3 mcu ordering forms to initiate an order for a rom-based mcu, first obtain the current ordering form for the mcu from a motorola representative. submit the following items when ordering mcus: ? a current mcu ordering form that is completely filled out (contact your motorola sales office for assistance.) ? a copy of the customer specification if the customer specification deviates from the motorola specification for the mcu ? customers application program on one of the media listed in 13.4 application program media
technical data mc68hc05k3 revision 4.0 128 ordering information motorola ordering information the current mcu ordering form is also available through the motorola freeware bulletin board service (bbs). the telephone number is (512) 891-free. after making the connection, type bbs in lowercase letters. then press the return key to start the bbs software. 13.4 application program media deliver the application program to motorola in one of the following media: ? macintosh ?1 3 1/2-inch diskette (double-sided 800 k or double-sided high-density 1.4 m) ? ms-dos ?2 or pc-dos tm 3 3 1/2-inch diskette (double-sided 720 k or double-sided high-density 1.44 m) ? ms-dos ? or pc-dos tm 5 1/4-inch diskette (double-sided double-density 360 k or double-sided high-density 1.2 m) use positive logic for data and addresses. when submitting the application program on a diskette, clearly label the diskette with the following information: ? customer name ? customer part number ? project or product name ? file name of object code ? date ? name of operating system that formatted diskette ? formatted capacity of diskette on diskettes, the application program must be in motorolas s-record format (s1 and s9 records), a character-based object file format generated by m6805 cross assemblers and linkers. 1. macintosh is a registered trademark of apple computer, inc. 2. ms-dos is a registered trademark of microsoft corporation in the united states and/or other countries.. 3. pc-dos is a trademark of international business machines corporation.
ordering information rom program verification mc68hc05k3 revision 4.0 technical data motorola ordering information 129 begin the application program at the first user rom location. program addresses must correspond exactly to the available on-chip user rom addresses as shown in the memory map. write $00 in all non-user rom locations or leave all non-user rom locations blank . refer to the current mcu ordering form for additional requirements. motorola may request pattern re-submission if non-user areas contain any non-zero code. if the memory map has two user rom areas with the same addresses, then write the two areas in separate files on the diskette. label the diskette with both filenames. in addition to the object code, a file containing the source code can be included. motorola keeps this code confidential and uses it only to expedite rom pattern generation in case of any difficulty with the object code. label the diskette with the filename of the source code. 13.5 rom program verification the primary use for the on-chip rom is to hold the customers application program. the customer develops and debugs the application program and then submits the mcu order along with the application program. motorola inputs the customers application program code into a computer program that generates a listing verify file. the listing verify file represents the memory map of the mcu. the listing verify file contains the user rom code and may also contain non-user rom code, such as self-check code. motorola sends the customer a computer printout of the listing verify file along with a listing verify form. to aid the customer in checking the listing verify file, motorola will program the listing verify file into customer-supplied blank preformatted macintosh or dos disks. all original pattern media are filed for contractual purposes and are not returned. check the listing verify file thoroughly, then complete and sign the listing verify form and return the listing verify form to motorola. the signed
technical data mc68hc05k3 revision 4.0 130 ordering information motorola ordering information listing verify form constitutes the contractual agreement for the creation of the custom mask. 13.6 mc order numbers table 13-1 shows the mc order numbers for the available package types. table 13-1. mc order numbers mc order number operating temperature range mc68hc05k3p (standard) C0 c to 70 c mc68hc05k3cp (extended) C40 c to 85 c mc68hc05k3dw (standard) C0 c to 70 c mc68hc05k3cdw (extended) C40 c to 85 c mc68hc05k3csd C40 c to 85 c notes: p = plastic dual in-line package dw = small outline integrated circuit (soic) package sd = super small outline package (ssop)

mc68hc05k3/d motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee r egarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and speci? cally disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or speci ?cations can and do vary in different applications and actual performance may vary over time. all operating parameters, including "typicals" must be validated for each customer applica tion by customer's technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failu re of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized applicati on, buyer shall indemnify and hold motorola and its of?cers, employees, subsidiaries, af?liates, and distributors harmless against all claims, costs, damages, and expenses, and rea sonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that mot orola was negligent regarding the design or manufacture of the part. motorola and are registered trademarks of motorola, inc. motorola, inc. is an equal opportuni ty/af?rmative action employer. how to reach us: usa/europe/locations not listed: motorola literature distribution, p.o. box 5405, denver, colorado 80217, 1-800-441-2447 or 1-303-675-2140. customer focus center, 1-800-521-6274 japan: motorola japan ltd.: spd, strategic planning of?ce, 141, 4-32-1 nishi-gotanda, shinagawa-ku, tokyo, japan. 03-5487-8488 asia/pacific: motorola semiconductors h.k. ltd., 8b tai ping industrial park, 51 ting kok road, tai po, n.t., hong kong. 852-26629298 mfax?, motorola fax back system: rmfax0@email.sps.mot.com; http://sps.motorola.com/mfax/; touchtone, 1-602-244-6609; us and canada only, 1-800-774-1848 home page: http://motorola.com/sps/ mfax is a trademark of motorola, inc. ? motorola, inc., 1998


▲Up To Search▲   

 
Price & Availability of HC05K3GRS

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X